Answer the question
In order to leave comments, you need to log in
How to change the appearance of an EntityType in Symfony2?
There is a field parent, EntityType
$builder->add('parent', EntityType::class, array(
'class' => 'AdBundle:AdLocation',
'choice_label' => 'title',
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('l')
->where('l.visible = :visible')
->setParameter('visible', true);
}
))
Answer the question
In order to leave comments, you need to log in
In general, if your countries, cities and districts are stored in different tables, you can use dependent fields. For example, one of their such implementations is ShtumiUsefulBundle .
It can be expensive to display everything in one field at once, and the client’s page can slow down.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question