Is there anything like Dwoo-s {with} or {loop} in Smarty 3 or earlier?

frest

New Member
{with} and {loop} plugins in Dwoo template engine change default context for variable name resolution.If in Dwoo you feed template:\[code\]{$arr.foo}{with $arr} {$foo} / {$arr.foo} {/with}\[/code\]with data:\[code\]array('arr' => array( 'foo' => 'bar' ))\[/code\]it will output:\[code\]barbar / \[/code\]because second {$arr.foo} actually means {$arr.arr.foo} in global context.Do you know how can I achieve similar effect in Smarty?Is there some builit in functionality or third party plugin that might allow me to have this?Do you have any idea how to build such a plugin if it does not exist?
 
Back
Top