Answer the question
In order to leave comments, you need to log in
How to pull out additional information in the form for a related entity in Symphony2?
there are two entities interconnected
Locations <-> ManyToOne <-> Locationstype
when I make a form, for example, a new Location
in the Location_type field, thanks to the connection, all values from the Locationtype entity are pulled up
<select id="book_fromBookType" name="book[fromBookType]">
<option value=""></option>
<option value="1">Airport</option>
<option value="2">Address</option>
<option value="3">Train Station</option></select>
<select id="book_fromBookType" name="book[fromBookType]">
<option value=""></option>
<option value="1" data-type="air">Airport</option>
<option value="2" data-type="adr">Address</option>
<option value="3" data-type="train">Train Station</option>
</select>
<select>
<option value=""></option>
<option value="1" data-type="air">Аэропорт Домодедово</option>
<option value="2" data-type="adr">Гдето там</option>
<option value="3" data-type="train">Киевский вокзал</option>
<option value="4" data-type="train">Ярославский вокзал</option>
</select>
Answer the question
In order to leave comments, you need to log in
- you can add attributes like this :)
- or customize the output template, dock on the topic , and more specifically choice_widget_options + apply to the field like this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question