I need a PHP template parser that is capable of parsing the following format:
{users}
{name}
{age}
{posts}
{title}
{body}
{comments}
{comtitle}
{combody}
{/comments}
{/posts}
{/users}
All template parsers I've looked into... are either not recursive enough or come with unnecessary template constructs that look so similar to PHP syntax that it's not worth it. This is the default way CodeIgniter templates work, but they do not dig down deep enough.
Believe it or not, none of the parsers in this blog post appear to be able to do this. Some can achieve it, but with a syntax that approaches PHP's native foreach function.
Do you know if a parser exists? Or have you created one that reads this type of structure? The desired parser should be able to dig down infinitely further provided that an even more nested array was provided to it.
Specifically, I'm looking for a CodeIgniter solution, but any PHP solution will suffice at this point as I've been investigating this for a few days now.
Thanks!