Welcome Guest, Not a member yet? Register   Sign In
Smarty Variable Modifiers
#1

[eluser]Pascal Kriete[/eluser]
I just started working on a project that needs a templating engine. Nothing fancy, but I wanted some easy modifiers in the view, and the native Parser is just too limited. So I made a Parser extension to allow things such as:
Code:
We can have some {somevar|lower|capitalize|cat:s}.
Code:
$data['somevar'] = "VARIABLE";
$this->parser->parse('test', $data);

Will print:
Quote:We can have some Variables.
Get it here:
Wiki

Constructive criticism is encouraged ;-) .

ps. just realized that cat is broken (only takes words), I'll fix it later.




Theme © iAndrew 2016 - Forum software by © MyBB