I have a simple model named Service with attributes(ServiceId, name, description, Image) , and i want to display all the records in a view using CListview but only the name and description attribute, not all of them.
I am able to display the model but i cant find a solution to hide the id and image attributes.
Can anybody give a solution?
Thanks in advance.
Here is my Code :
Controller :
public function actionIndex()
{
$model = new Service();
$this->render('index',array(
'model'=>$model,
));
}
and my View:
<h1>Services</h1>
<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$model->search(),
'itemView'=>'_view',
));
?>