Open rpostolov opened 9 years ago
Hi @rpostolov
This issue should be created into the AdmingeneratorGeneratorBundle... But let's give you an answer there:
In your [Edit|New]FormType generated file, you can add/customize form options. I think so there you should write your own QueryBuilder. Something like this:
protected function getFormOption($name, array $formOptions)
{
if ('country' === $name) {
$formOptions['query_builder'] = function (CountryRepository $countryRepository){
return $countryRepository->getFindQueryBuilderOrderedByName();
};
}
}
return $formOptions;
}
By the way, do you know Symfony provides such a form (maybe out of your context): http://symfony.com/fr/doc/current/reference/forms/types/country.html
Hoping that helps,
Hi @sescandell,
Thank you for the answer, i will try this today.
Sorry, i thought that it's belong to Avocode, my bad.
Have a nice day !
Hi,
I have a simple question, i search for the solution but i couldn't find an answer.
I have a field which is a list of countries, but its not sorted. I want to know if it's possible to add an sort option in the generator.yml and if it's yes how.
Here is a part of my admin-generator.yml file
Thanks :)