Widget无法再其他模板传递数组

浏览:485 发布日期:2015/08/09 分类:求助交流 关键字: widget,数组
public function index(){
        $a = array('id'=>5,'name'=>'xiaoming','age'=>'17');
        $this->assign('axxa',$a);
        $this->display('Index:test');
        
        }
        
    public function test(){        
        return "XIAOMING";        
        }    
- ---- test.html{:W('Base/test')}
<foreach name="axxa" item="title">
    {$title.id}:{$title.name}

</foreach>
页面结果:
XIAOMING

数组无法遍历



最佳答案
评论( 相关
后面还有条评论,点击查看>>