用smarty 模板的时候0被控代替了 这个要怎么解决?? 在线等 先谢谢了

解决方案 »

  1.   

    {foreach from=$sell_array key=k item=v}
    {$v['group_id']} //这里是0的时候不显示0
    {/foreach}[/code]
      

  2.   

    是不是foreach后面的k和v忘记加$符号了
      

  3.   

    我用的是Smarty 3.0.6版本的
    配置
    $smarty=new Smarty();
    $smarty->template_dir=path_root."//tpl/";
    $smarty->compile_dir=path_root."//smarty/templates_c/";
    $smarty->config_dir=path_root."//smarty/configs/";
    $smarty->cache_dir=path_root."//smarty/cache/";$smarty->cache_lifetime = 0; //设置缓存时间  
    $smarty->caching = false; //设置缓存方式 $smarty->left_delimiter = "{";  
    $smarty->right_delimiter = "}";
      

  4.   

    {foreach from=$sell_array key=k item=v}
    {$v['group_id']} //这里是0的时候不显示0 显示空白
    {/foreach}
    [/code]