yii gridview 生成隐藏列

代码如下:

[
    'label' => 'Executive Name',
    'attribute' => 'cs.first_name',
    'visible' => '0',
],

如果还需要放入条件:

[
    'label' => 'Executive Name',
    'attribute' => 'cs.first_name',
    'visible' => function(){
         if (condition) {
                return '1';
          } else {
                return '0';
          }  
     }
],    

 

posted @ 2016-11-17 10:54  小白洗澡澡  阅读(801)  评论(0)    收藏  举报