yii use a model related function in a view

2019-07-31 11:10发布

问题:

I have no reputation to comment on a question, so I am making a new one. But my question is related to another question: How to convert model data objects array to dataProvider

So.... if you read the question, my doubt is:

I need to ask for help to a new thing that this subject rises. I would like to get a function result as the data of a column, but this function is inside the Friend object. Its not possible to do:

array(
    'name'=>$model->friends->getAttributeLabel('column_of_friend_model'),
    'value'=> $model->friends->takeDataFromFriendModelThatIsActuallyInOtherModel(),
),

Can someone please help!? Thanks a lot!