Customized ClistView and CActiveDataProvider

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


 * Lists all models.


public function actionIndex()


    $dataProvider=new CActiveDataProvider('User');





And this is my view file of the above action:

 <?php $this->widget('zii.widgets.CListView', array(



 )); ?>

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.

change _view template.

It works but when i view a particular user, i still see the username and password. How to hide them in cdetailView?

Did you change the _view template? You just need to remove the data you dont want to display.

Yes i changed it, but when i click the user id link, the detail view still has the password and email rows.

If you use the default code generated by Gii… by clicking on id link the "view.php" file is rendered… so you need to edit that file too