You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
fields:
country:
label: Country
addFormOptions:
required: true
Thanks :)
The text was updated successfully, but these errors were encountered:
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:
protectedfunctiongetFormOption($name, array$formOptions)
{
if ('country' === $name) {
$formOptions['query_builder'] = function (CountryRepository$countryRepository){
return$countryRepository->getFindQueryBuilderOrderedByName();
};
}
}
return$formOptions;
}
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 :)
The text was updated successfully, but these errors were encountered: