CGridView中变量 $data 为啥为空?




$sql='select * from tble';

$command = Yii::app()->db->createCommand($sql);

$result = $command->queryAll();


$dataProvider=new CArrayDataProvider($result, array(

                    'id'=>'game_data',

                    'sort'=>array('attributes'=>array('time_key'=>'时间', 'view'=>'显示次数', 'click'=>'点击次数','click_rate'=>'点击率(%)',),),

                    'pagination'=>array('pageSize'=>50,),));


$this->widget('zii.widgets.grid.CGridView', array(

        'dataProvider'=>$dataProvider,

        'columns'=>array('time_key','view','click','click_rate',

            array('class'=>'CLinkColumn','label'=>'详细','urlExpression'=>'Yii::app()->createUrl("play_look_log/admin",array("time"=>$data->time_key))',),

        ),



代码如上,其中Yii::app()->createUrl("play_look_log/admin",array("time"=>$data->time_key))中$data 没数据?奇怪了

求高手解释?

搞定 对于查询出来是数组的直接这样 “time”=>$data[‘time_key’]