Archives de
Tag: fosuser

API Platform + FOSUserBundle + LexikJWTAuthenticationBundle

API Platform + FOSUserBundle + LexikJWTAuthenticationBundle

Symfony: 3.2.2 API Platform: 2.0.3 FOSUserBundle: 2.0.0-beta2 LexikJWTAuthenticationBundle: 2.1.1 En premier lieu nous allons cloner le dépôt API Plaftorm: composer create-project api-platform/api-platform bookshop-api Une fois fait, nous installons FOSUserBundle et LexikJWTAuthenticationBundle via composer: composer require friendsofsymfony/user-bundle:2.0.0-beta-2 composer require lexik/jwt-authentication-bundle Puis nous activons les bundles fraichement installé dans AppKernel.php: public function registerBundles() { return array( // … new FOS\UserBundle\FOSUserBundle(), new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(), ); } Nous créons notre entité User.php: <?php namespace AppBundle\Entity; use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; use FOS\UserBundle\Model\User as BaseUser;…

Lire la suite Lire la suite

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  

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