How do hide certain fields from CRUD pages?

Let’s say i have a users table with password field then i generated the CRUD and i want the password field to be hidden on view & list but shown on create & update.


you should comment out your password field in _view.php (for the list) and view.php.

You should be able to dynamically make the fields invisible during runtime by changing its css class.

However, I’m not sure if that might be a security issue: maybe the password is still send to client - although invisible at first.

So it should be a better idea to test in the view if the field should be generated at all.

@michel: Yeah the field can be hide by changing the files you mentiond. Thanks.

@Gerhard Liebenberg:

The password is encrypted but like you said the password field should not be retrieve by CRUD at all but during add/update it should insert the value. I think we need a display only field that can be add/update in yii’s CRUD.