Welcome Guest, Not a member yet? Register   Sign In
Parser extras
#1

(This post was last modified: 10-31-2017, 06:39 PM by orionstar.)

Hi guys!

I need a way to map automatically all public variable and methods of an object as plugins.
Also it would be nice if I can access the vars and methods on the objects namespace.

For example:
I have a blog plugin class with methods posts, categories, authors, comments etc... then I would like to access these this way:

Code:
{+ blog:posts +}
{title}
{+ /blog:posts +}

The ":" should be configurable, just like the delimeter. Also I suggest to get rid of the "+" as the plugin marker, it makes harder to the end users to understand the system (or if its not easy to merge the simple parsing of a variable and a plugin, then at least it should be configurable). 
I will give access my users to edit email templates so I should be able to remove all plugin and add only the selected few (of course I can achieve this if I make a new parser instance and add the plugins again but this is not the best solution, because in preview mode I would like to compile the email templates with the rest of the page).
Is it possible now to add plugins globally for all parser instances that exists or will be instantianeted later?
Is it possible to pass "collections" as data to the parser or I have to create associate arrays all the time? (in the parser code I only see the latter)
Can I call other vars or plugins in a template? for example {+ blogPosts postsPerPage={ postsPerPage } +} or should I create a filter for this or those can only be used for scalar values?

Based on the previous questions and requests should I use another Parser solution? Big Grin I wish lex for CI4 or something with the same syntax...

Best regards,
orionstar
Reply


Messages In This Thread
Parser extras - by orionstar - 10-31-2017, 06:35 PM
RE: Parser extras - by dmyers - 10-31-2017, 07:43 PM
RE: Parser extras - by kilishan - 10-31-2017, 08:11 PM
RE: Parser extras - by orionstar - 10-31-2017, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB