小弟刚解除smarty 怎么调试也不成功啊,求大神
首先print_r 的数组是这样的Array
(
    [0] => 19
    [order_id] => 19
    [1] => 
    [uid] => 
    [2] => 
    [table_id] => 
    [3] => 2013-04-15 11:16:13
    [order_time] => 2013-04-15 11:16:13
    [4] => 0
    [pay] => 0
    [5] => 10,14
    [menu_id] => Array
        (
            [0] => Array
                (
                    [0] => 10
                    [menu_id] => 10
                    [1] => 东坡肉
                    [menu_name] => 东坡肉
                )            [1] => Array
                (
                    [0] => 14
                    [menu_id] => 14
                    [1] => 北海道烤鱼
                    [menu_name] => 北海道烤鱼
                )        )    [6] => 
    [re] => 
    [7] => 网上下单完毕
    [pay_name] => 网上下单完毕
    [8] => 0
)html部分是这样写的,一直改,一都没成功一次,求大神给我改改html
 {?foreach from=$order_array item=val?} 
      <tr>
        <td height="20" bgcolor="#FFFFFF"><div align="center">
          <input type="checkbox" name="checkbox2" id="checkbox2" />
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19">{?val.order_id?}</span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">{?val.uid?}</div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">{?val.table_id?}</div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">{?val.order_time?}</div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">{?val.pay_name?}</div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"> {?foreach  from=val.menu_id item=val2?} {?val2.menu_name?} {?/foreach?} </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><a href="/www/order/order_next.php?id={?$order_array[list].order_id?}">完成制作转给收银员</a></div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21">删除 | 查看</div></td>
        </tr>{?/foreach?}SmartyHTMLmenuCheckBox

解决方案 »

  1.   

    可以参考下这篇文章:http://blog.51yip.com/smarty/903.html
    {section loop=$twoarray name=two }    {section loop=$twoarray[two] name=aaa }  
       二维tkey={$smarty.section.aaa.index}  
       二维value={$twoarray[two][aaa]}
      {/section}  {/section}  
      

  2.   

    Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template &quot;D:\www\www\templates\order\order.html&quot; on line 78 &quot;&amp;lt;td height=&amp;quot;20&amp;quot; bgcolor=&amp;quot;#FFFFFF&amp;quot; class=&amp;quot;STYLE6&amp;quot;&amp;gt;&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;STYLE19&amp;quot;&amp;gt;{?val.['order_id']?}&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&quot; - Unexpected &quot;.&quot;, expected one of: &quot;?}&quot; , &quot; &quot; , ATTR' in D:\www\www\smarty\sysplugins\smarty_internal_templatecompilerbase.php:665 Stack trace: #0 D:\www\www\smarty\sysplugins\smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 D:\www\www\smarty\sysplugins\smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(59, '.') #2 D:\www\www\smarty\sysplugins\smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doPars in D:\www\www\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 665还是不管用,报错,这样的
      

  3.   

    不对啊。。
    外层的循环是 section loop=$外层数据名 name=外层名
    内层是是     section loop=$外层数据名[外层名] name=内层名
    这个格式是不能变的
      

  4.   


    {foreach from=xxx item=xxxvalues}
    {foreach from=$xxxvalues item=subxxx}
    {/foreach}
    {/foreach}