Customized ClistView to hide some information

717 views Asked by At

This is my UserController, index Action, zii generated file , from my model User:

/**
 * Lists all models.
 */
public function actionIndex()
{
    $dataProvider=new CActiveDataProvider('User');
    $this->render('index',array(
        'dataProvider'=>$dataProvider,
    ));
}

And this is my view file of the above action:

 <?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
 )); ?>

These are all defaults. What i need is to be able to hide my users password and email, because now with the default crud operation are visible. When i go to my user controller action index i want a list with all my users but only with their user id and the username, without precious information like email and password.

1

There are 1 answers

0
Alexey Morozov On BEST ANSWER

Open file webapp_folder/protected/views/user/_view.php and delete lines with password and email.