smarty assign

171

smarty assign -

{assign var="name" value="Bob"}
{assign "name" "Bob"} {* short-hand *}

The value of $name is {$name}.


{* Other cool examples *}
{foreach $videos as $video}
   {$video.title_ns = {$video.title|lower|replace:' ':'-'}}
{/foreach}

{assign var="name" value="somestring_{$item.id}"} 

Comments

Submit
0 Comments