【问题标题】:Smarty Error : unrecognized tag 'function'Smarty 错误:无法识别的标签“功能”
【发布时间】:2013-07-09 08:41:37
【问题描述】:

这是我的代码,我想在 smarty 中定义一个函数。

{function name=menu level=0}
<ul class="level{$level}">
{foreach $data as $entry}
{if is_array($entry)}
<li>{$entry@key}</li>
{menu data=$entry level=$level+1}
{else}
<li>{$entry}</li>
{/if}
{/foreach}
</ul>
{/function}

但这是我遇到的错误,有人可以帮忙吗?

Fatal error: Smarty error: [in components/scripts.tpl line 1]:
syntax error: unrecognized tag 'function' (Smarty_Compiler.class.php, line 590)
in D:\xampp\htdocs\local_games\layout\default\php\Smarty\Smarty.class.php on line 1095

【问题讨论】:

    标签: php smarty


    【解决方案1】:

    {function}Smarty3-specific,但您可能正在使用 Smarty2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-06
      • 2022-01-05
      相关资源
      最近更新 更多