Welcome Guest, Not a member yet? Register   Sign In
Opinion: Template Engine Integration RIP?
#3

jlp, if we are going to be loading a "parser" as a service in CI4 using a standard class name like CI3's "parser" for that service is great but, how will multiple 3rd party developers know which parser engine is being used and how can we use multiple at the same time?

1. I use pyrocms/lex for my email template "views"
2. I use 3rd party Library "foobar" which wants me to use template library "barfoo" because it's views are in "barfoo" format
3. I use 3rd party Library "aaaa" which wants me to use template library "zzzz" because it's views are in "zzzz" format
4. I use "handlebars" for my code because of course my views are in handlebars format.

Of course in my own code I can load the template library pyrocms/lex & handlebars directly and call them as needed.
Something like this:
$this->lex_parser->parse('email_template', $data);
- and -
$this->handlebars_parser->parse('blog_template', $data);

If 3rd party code assume you are using there chosen "parser" how will they work together?
I assume they will both just use.
$this->parser->parse('some_template', $data);
but this won't work for templates / plugins in different formats.

Maybe register template file extensions and/or folders as certain formats?

I hope this is clear?

DMyers
Reply


Messages In This Thread
RE: Opinion: Template Engine Integration RIP? - by dmyers - 07-20-2016, 06:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB