<?php echo $form->dropDownList($model,'status',array("1"=>"Active","0"=>"InActive")); ?>
i want that when i retrieve status in CDetailView it shows name active instead of value . Please tell me how can i do like this? thanks in advance.
Posted 01 March 2013 - 03:04 AM
<?php echo $form->dropDownList($model,'status',array("1"=>"Active","0"=>"InActive")); ?>
Posted 01 March 2013 - 03:17 AM
<?php echo $form->dropDownList($model,'status',array("1"=>"Active","0"=>"InActive"),array('empty'=>'Select Value')); ?>
Posted 01 March 2013 - 03:35 AM
zohaib, on 01 March 2013 - 03:04 AM, said:
<?php echo $form->dropDownList($model,'status',array("1"=>"Active","0"=>"InActive")); ?>
Posted 01 March 2013 - 08:37 AM
macinville, on 01 March 2013 - 03:35 AM, said:
array ( 'name'=>'country', 'value'=>$model->country->country_id, ),
Posted 01 March 2013 - 10:41 AM
public static function getStatus($status){
return $status=="Active" ? 1:0;
}
... 'attributes'=>array( ...//other fields array( 'name'=>'status', 'value'=>Status::getStatus($model->status) ) ... ), ...
Posted 01 March 2013 - 12:21 PM
macinville, on 01 March 2013 - 10:41 AM, said:
public static function getStatus($status){
return $status=="Active" ? 1:0;
}
... 'attributes'=>array( ...//other fields array( 'name'=>'status', 'value'=>Status::getStatus($model->status) ) ... ), ...
Posted 01 March 2013 - 07:54 PM