Hi,
I have a mysql table Vehicles containing information, eg. color, body style (only integer).
For this reason I have component contining color and body styles array:
'value in db' => 'Name'
private $vehicleBodyStyle = array(
'1' => 'Sedan', '2' => 'SW', '3' => 'Convertible', '4'=> 'Coupe',
'50' => 'Other'
);
private $vehicleColors = array(
'1' => 'Black', '2' => 'Grey', '3' => 'White', '4'=> 'Green', '5' => 'Red',
'50' => 'Other'
);
I’m listing vehicles with Zii CListView.
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$vehicles,
'itemView' => '_vehicle'
));
I need to replace indexes 1, 2, 3 with their values.
Should I do this in _vehicle.php view (but don’t know how to pass arrays to this view using CListView) or somehow change CActiveDataProvider returned object before passing to CListView?