Answer the question
In order to leave comments, you need to log in
How can administrator frozennode for name_field in relationship select value from multiple table fields?
I have a many-to-many relationship and the code looks like this
'apartments' => [
'type' => 'relationship',
'name_field' => 'address',
],
Answer the question
In order to leave comments, you need to log in
I have already written many times: do not use this craft for anything that is more complicated than the ToDo list.
You can't even open the documentation and read 5 lines of text.
administrator.frozennode.com/docs/field-type-relat...
Use the overloaded accessor for the apartment_address field as the name_field .
That is, add to the model:
public function getAddressApartmentAttribute() {
return $this->attributes['квартира'] . " - " . $this->attributes['address'];
}
'apartments' => [
'type' => 'relationship',
'name_field' => 'address_apartment',
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question