I have 2 attributes in model jobs
, they are tag
and category
, I want to make a dropDownList that display the value of tag
who have category
equal 'salary', here is my code:
$s= CHtml::listData($model2, 'salary', 'tag');
echo CHtml::dropDownList('salary', 'salary', $s);
my db:
tag / category
1 / val1
2 / val1
a / val2
1000 / salary
2000 / salary
but I got a dropDownList that contains only the last value who have these conditions. what is the wrong in my code?