Archives de
Tag: sonata

Ajouter un champ a un utilisateur avec le bundle sonatauserbundle [FR]

Ajouter un champ a un utilisateur avec le bundle sonatauserbundle [FR]

Si vous utilisez le bundle sonata-user-bundle il y a de fortes chances pour que vous ayez utilisé le bundle sonata-easy-extends afin de généré votre bundle de gestion des utilisateurs. J’ai découvert ce weekend qu’afin d’ajouter un nouveau champ sur un utilisateur lors de l’utilisation du bundle sonatauserbundle, il faut modifier le fichier Application/Sonata/UserBundle/Resources/config/doctrine/User.orm.xml  

Le tri par défaut dans Sonata Admin

Le tri par défaut dans Sonata Admin

J’ai récemment dû ajouter un tri par défaut sur une de mes classes admin du bundle sonata admin. Après une petite recherche, j’ai finalement trouvé qu’il suffit de surcharger une variable: protected $datagridValues = array( ‘_sort_order’ => ‘DESC’, ‘_sort_by’ => ‘day’ ); Mes données serons dorénavant ordonnées en fonction du la valeur day dans l’ordre décroissant.

Symfony2.1 + sonata-admin + sonata-user +fos-userbundle [EN]

Symfony2.1 + sonata-admin + sonata-user +fos-userbundle [EN]

Hy, everybody, today we will see how to install Symfony2.1 and the following bundles: FOSUserBundle SonataAdminBundle SonataUserBundle tl;dr: There is a GitHub repository with the project. The first step is to create the project with the following command line: composer create-project symfony/framework-standard-edition sonataadmin.fr Then we edit the composer.json file to add the bundles: « sonata-project/admin-bundle »: « dev-master », « friendsofsymfony/user-bundle »: « dev-master », « sonata-project/user-bundle »: « dev-master », « sonata-project/doctrine-orm-admin-bundle »: « dev-master » Update the AppKernel.php file to add the following bundles: new FOS\UserBundle\FOSUserBundle(), new Sonata\jQueryBundle\SonatajQueryBundle(), new Sonata\AdminBundle\SonataAdminBundle(), new Sonata\BlockBundle\SonataBlockBundle(), new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),…

Lire la suite Lire la suite

Symfony2.1 + sonata-admin + sonata-user +fos-userbundle [FR]

Symfony2.1 + sonata-admin + sonata-user +fos-userbundle [FR]

Salut à vous, aujourd’hui nous allons voir comment installer Symfony2.1 et les bundles suivants: FOSUserBundle SonataAdminBundle SonataUserBundle La première étape est bien entendu la création du projet à l’aide de la commande suivante: composer create-project symfony/framework-standard-edition sonataadmin.fr Éditez le fichier composer.json pour y rajouter les bundles suivants : « sonata-project/admin-bundle »: « dev-master », « friendsofsymfony/user-bundle »: « dev-master », « sonata-project/user-bundle »: « dev-master », « sonata-project/doctrine-orm-admin-bundle »: « dev-master » Mettez à jour votre fichier AppKernel.php avec les bundles suivants : new FOS\UserBundle\FOSUserBundle(), new Sonata\jQueryBundle\SonatajQueryBundle(), new Sonata\AdminBundle\SonataAdminBundle(), new Sonata\BlockBundle\SonataBlockBundle(), new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), new…

Lire la suite Lire la suite