2009/08/27

call native php function in smarty

I bet you know we can use php function in the smarty condition clause, like,
{if count($arr)} do something ... {/if}

But if we want to display array size, we cannot use {count($arr)}, but we can use,
{$arr|@count}

So to call native php function, we can use below format:
{$input_parameter|@native_phpfunction}
Note:
  1. $input_parameter is smarty variable
  2. native_php_function, like sizeof, count, round, etc..

No comments:

Post a Comment