How to assign an array within a smarty template file?

前端 未结 5 675
萌比男神i
萌比男神i 2020-12-09 07:53

I was wondering if it was possible to assign an array to a variable within a Smarty template file? I have tried this

{assign var=\'file\' value = array(\'dir         


        
5条回答
  •  旧巷少年郎
    2020-12-09 08:12

    I just found another answer here that allows you to do this without the use of {php} tags (recommended by Smarty)

    {assign var='icon' value=','|explode:"dir,doc,exe"}
    

    still open to more ideas though...

提交回复
热议问题