smarty foreach 属性名称不起作用
smarty foreach attribute name not working
语法是否
name=foo_{$_id}
正确吗?这种语法不是我的概念。
<html>
<head>
<title>Smarty</title>
</head>
<body>
{foreach from=$pages key=m item=i name=foo_{$_id}}
{/foreach}
</body>
</html>
因为我得到一个错误:
[13-Aug-2016 17:30:01 ...] PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/././././././././test.tpl" on line 36 "{foreach from=$test.params.rows key="rowId" item="rowText" name="rows_{$id}"}" 'name' attribute/variable has illegal value <--
thrown in /./././././smarty-3.1.29/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 36
尝试:
{foreach from=$pages key=m item=i name="foo_`$_id`"}
语法是否
name=foo_{$_id}
正确吗?这种语法不是我的概念。
<html>
<head>
<title>Smarty</title>
</head>
<body>
{foreach from=$pages key=m item=i name=foo_{$_id}}
{/foreach}
</body>
</html>
因为我得到一个错误:
[13-Aug-2016 17:30:01 ...] PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/././././././././test.tpl" on line 36 "{foreach from=$test.params.rows key="rowId" item="rowText" name="rows_{$id}"}" 'name' attribute/variable has illegal value <--
thrown in /./././././smarty-3.1.29/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 36
尝试:
{foreach from=$pages key=m item=i name="foo_`$_id`"}