Hey, i think this will do the work for you:
Controller code:
foreach (NewsCategories::find() as $item) {
echo $item->getIsActive() . '<br/>';
}
exit;
Model (here you can put your switch clause from your first comment:
public function getIsActive()
{
// replace this logic with your switch and return result;
return $this->is_active ? 'Yes' : 'No';
}
Thats an example from my project. In my DB i store is_active as 0/1 and with this example i get this as print results
Yes
Yes
No
Yes