mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Sort case insensitive
This commit is contained in:
parent
070b184dbe
commit
7b7c327a9a
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
* Copyright (C) 2014 Champs-Libres <info@champs-libres.coop>
|
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -21,11 +21,9 @@
|
|||||||
namespace Chill\MainBundle\Form\Type;
|
namespace Chill\MainBundle\Form\Type;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||||
use Chill\MainBundle\Entity\Country;
|
use Chill\MainBundle\Entity\Country;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
|
use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
@ -34,6 +32,7 @@ use Doctrine\Common\Persistence\ObjectManager;
|
|||||||
* Extends choice to allow adding select2 library on widget
|
* Extends choice to allow adding select2 library on widget
|
||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
|
* @author Marc Ducobu <marc.ducobu@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class Select2CountryType extends AbstractType
|
class Select2CountryType extends AbstractType
|
||||||
{
|
{
|
||||||
@ -79,7 +78,7 @@ class Select2CountryType extends AbstractType
|
|||||||
$choices[$c->getId()] = $c->getName()[$locale];
|
$choices[$c->getId()] = $c->getName()[$locale];
|
||||||
}
|
}
|
||||||
|
|
||||||
asort($choices);
|
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
||||||
|
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
'class' => 'Chill\MainBundle\Entity\Country',
|
'class' => 'Chill\MainBundle\Entity\Country',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user