$value = app\models\SectionTranslation::find()
->select(['section_id', 'name'])
->where(['=', 'section_id', $iSection['id']])
->andWhere(['=', 'language_id', $lang])
->one();
$nam = $value->name;
I want to use $value->name but I can't. I get "Trying to get property 'name' of non-object" error. But if I write
var_dump($nam);exit;
after the last line of code, I can show correctly the result on my screen:
string(10) "Tree"
Any idea of the problem or the solution?
Thanks you.