Php yii如何在yii网格列表中搜索时隐藏列

Php yii如何在yii网格列表中搜索时隐藏列,php,yii,Php,Yii,我尝试过使用数组_filter(),但对于已发布/未发布的列仍然不起作用。实际上,当搜索字段不为空时,我想隐藏具有移动图标的列 我们可以在数组_filter()中使用strlen作为回调函数 public function actionAdmin() { $model=new InfoCategories('search'); $model->unsetAttributes(); // clear any default values $model->del

我尝试过使用数组_filter(),但对于已发布/未发布的列仍然不起作用。实际上,当搜索字段不为空时,我想隐藏具有移动图标的列


我们可以在数组_filter()中使用strlen作为回调函数
public function actionAdmin()
{
    $model=new InfoCategories('search');
    $model->unsetAttributes();  // clear any default values
    $model->del_flg=0;
    $enableSorting = TRUE;
    if (isset($_GET['InfoCategories'])) {
        $model->attributes=$_GET['InfoCategories'];
        if(array_filter($_GET['InfoCategories'])){
            $enableSorting = FALSE;
        }
    }

    $statusList = array("0"=>t("common","UnPublished"), "1"=>t("common","Published"));
    $this->render('admin',array(
        'model'=>$model,
        'statusList'=>$statusList,
        'enableSorting'=> $enableSorting,
    ));
}
public function actionAdmin()
{
    $model=new InfoCategories('search');
    $model->unsetAttributes();  // clear any default values
    $model->del_flg=0;
    $enableSorting = TRUE;
    if (isset($_GET['InfoCategories'])) {
        $model->attributes=$_GET['InfoCategories'];
        if(array_filter($_GET['InfoCategories'], 'strlen')){
            $enableSorting = FALSE;
        }
    }

    $statusList = array("0"=>t("common","UnPublished"), "1"=>t("common","Published"));
    $this->render('admin',array(
        'model'=>$model,
        'statusList'=>$statusList,
        'enableSorting'=> $enableSorting,
    ));
}