quicktemplate icon indicating copy to clipboard operation
quicktemplate copied to clipboard

Suggestion for executing templates with location/path as a variable

Open stevielj opened this issue 9 years ago • 2 comments

I'm trying to think of a way to execute templates based on router parameters. If I have a large collection of templates arranged in a folder structure, I'd like to be able execute one via the path without explicitly wiring everything up before hand. I'd love to see an option on qtc to generate a map of function pointers where I could look for a template at a particular path, execute it if it exists, or choose a template in a parent location if it doesn't. (hope that makes sense, and I'm assuming that the template all need to take the same args) Eventually, I may actually store the templates in a database and write them out to the file system as part of the build process before invoking qtc. This would give me back some of the advantages of dynamic templates while enjoying the speed and efficiency of quicktemplates.

stevielj avatar Mar 24 '16 01:03 stevielj

@stevielj did you fixed this?

I think I need something similar here: https://github.com/valyala/quicktemplate/issues/58, right @valyala?

frederikhors avatar Jul 29 '19 08:07 frederikhors

Yes, it is quite similar to the issue described in #58 . Unfortunately the solution proposed by @stevielj looks quite complicated from user PoV. That's why it isn't implemented yet :(

valyala avatar Jul 29 '19 19:07 valyala