Answer the question
In order to leave comments, you need to log in
How to make an ajax request so that the virtual properties of the model come in response?
I make a get request on the rest controller. I get models, but models have properties created via get of type getOfffers. How to make models have an offers property when requested? I thought somehow through extraFields, but it didn't help. Tell me please
Answer the question
In order to leave comments, you need to log in
In ActiveRecord
public function fields()
{
$fields = parent::fields();
$fields = array_merge($fields, [
'offers',
]);
unset(
$fields['name'],//что то удалить
);
return $fields;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question