📜  smarty assign var - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:53.331000             🧑  作者: Mango

代码示例2
{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}"}