Hello.
I have a table with two fields for two languages:
text_en
text_es
I want to select the field, according to the language and this works fine:
$criteria->select = "code,text_$lang,active";
What I would like to do is select the field with an alias and then use that alias to return the value, somthing like this:
$criteria->select = "codigo,text_$lang as text,activo";
.
.
.
echo CHtml::encode($model->text)
But it doesn’t work, I get an error saying “Property “menu.text” is not defined.” (menu is the model)
Is it possible to do what I want?
Thanks!