In My view page ,
$cpfTabledropdown = ManageConfiguration::getModulesetting();
echo $form->dropdownList($useraccount, 'skill_type', $cpfTabledropdown, array('class' => 'form-control', 'prompt' => 'Select SKill Type', 'disabled' => $useraccount->id_type == 3 ? false : true));
In My Model Coding:
public static function getModulesetting() {
$models = HrmoduleSettings::model()->findAll('type="6"');
return CHtml::listData($models, 'id', 'name');
}
Now am want that return listdata in name concat some static data using column subcat ,How to concat that static data in that return name value in yii Like below PHP coding,
I want to show Dropdownlist data like Below PHP coding in YII.Its Php Coding its working Fine,But I don't know how to write in YII.IS it possible to write the below PHP coding in YII?
<select name ="UserAccount[skill_type]">
<?php
foreach ($cpfTabledropdown as $models) {
if ($models->subcat_type == 1)
{
$cate = "Skilled";
}
else {
$cate = "Unskilled";
}
?>
<option value ="<?php echo $models->id; ?>"><?php echo $cate . " " . $models->name; ?></option>
<?php
}
?>
</select>