2016-08-13 11 views
0

を働いていない属性名の構文Smartyのforeachの

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 

答えて

0

試してください:それは私の問題を解決していない

{foreach from=$pages key=m item=i name="foo_`$_id`"} 
+0

。 –

+0

別のエラーがありましたか? – jedifans

+0

キャッシュがクリアされています。私はこのエラーだけを受け取ります:[13-Aug-2016 18:31:08 ...] PHP致命的なエラー:Uncaught - > Smartyコンパイラ:テンプレートの構文エラー "file:/././././ ./././test.tpl "on line 36" {foreach from = $ test.params.rows key = "rowId" item = "rowText" name = "rows_' $ _id'"} 'name'属性/変数に不正な値があります。< - が/./././././smarty-3.1.29/libs/sysplugins/smarty_internal_templatecompilerbase.php 36行にスローされました –