Home > Backend Development > PHP Tutorial > Smarty中怎么样在变量中使用变量

Smarty中怎么样在变量中使用变量

WBOY
Release: 2016-06-23 14:09:34
Original
927 people have browsed it

  {foreach from=$kc item=eachone key=keyname }
  


  {$eachone.Client_id}
    {$eachone.Company}
    {$eachone.Tel}
    {$eachone.Appearance}
  
 {/foreach}
生成后是$eachone.Appearance段是0或1的数字,分别对应关闭和开启,我现在想把变成中文的关闭和开启,应该怎么做,不能用IF,因为以后状态类型还要增加


回复讨论(解决方案)

在php处理逻辑是最好的,何必劳烦smarty呢

模板是为了展示已有的数据用的
把模板弄的那么复杂,那 model 有干些什么呢?

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template