I have applied the example in the symfony documentation to reduce Code Duplication with "inherit_data".
http://symfony.com/doc/current/form/inherit_data_option.html
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
$builder->add('foo', LocationType::class, array(
'data_class' => 'AppBundle\Entity\Company'
));
}
It works good but when I use this exemple with a search form with GET method I get an url like this :
foo%5Baddress%5D=some+address&foo%5Bzipcode%5D=5000&foo%5Bcity%5D=paris&foo%5Bcountry%5D=france
and i'd like the url to be like this :
address=some+address&zipcode=5000&city=paris&country=france
How can I do that ?