For a project I'm working on, I need to parse a tiny flow-control language in PHP.
Smarty syntax would be ideal, but we wouldn't be able to use Smarty's caching and would only need a small subset of it's features (basically just {if}
, {else}
, {elseif}
, {/if}
and function plugins).
Despite the lack of caching, performance is a major factor; including the entire Smarty framework and disabling caching is too slow.
Is there any PHP framework that can handle Smarty-like syntax without any of the more advanced features. Doesn't need to be a perfect match or even a close match, just something I can mix with plain HTML.
Any code that parses and handles the if .. elseif .. else ..
logic would be appreciated too; I can hack in the rest myself.
Forgot to mention earlier; the templates are editable by users, so security is a concern.