I would like to define the format of an attribute in GridView
based on a db field value. I was trying for example like this:
'format' => function ($model) {return $model->format;}, // it should return 'boolean'
but I have tried many other ways also, but it's not working. I'm getting:
PHP Notice – yii\base\ErrorException
Trying to get property of non-object
If I'm simply returning format
as an attribute, it's working without any issues. It seems that it's not accepting it in the format
section.
Is it possible anyways what I'm trying to achieve? Can you please point me to the right direction?