symfony2-easyadmin

symfony fosuserbundle redirection after login

强颜欢笑 提交于 2019-12-25 07:52:36
问题 i have a login form what i want to do that if a user have role user tries to login he's redirected to page voiture_new and if an admin eventually has a role admin he's redirected to the admin page PS : i'm using easyadminbundle here's what i've added to the loginaction of my controller $authChecker = $this->container- >get('security.authorization_checker'); $router = $this->container->get('router'); if ($authChecker->isGranted('ROLE_ADMIN')) { return new RedirectResponse($router->generate(

add a virtual property in easy-admin bundle

删除回忆录丶 提交于 2019-12-25 00:22:18
问题 I'm currently working with the 2.3 version of the easy-admin bundle in Symfony 4. I try to create a virtual property for the new view. I have the following configuration #config/packages/easy_admin.yaml easy_admin: entities: Field: class: App\Entity\Field form: fields: - { type: tab, label: initial information, icon: pencil-alt } - name new: fields: - { property: toto, type: file } and my entity file: //src/Entity/Field.php /** * @ORM\Entity(repositoryClass="App\Repository\FieldRepository") *

symfony easyadmin one to many form

我们两清 提交于 2019-11-28 01:19:30
问题 i am new to the easyadmin bundle and i am looking if it is possible to add childs directly from the parent object So i got 3 objects : - Recipe namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Recipe * * @ORM\Table(name="recipe") * @ORM\Entity(repositoryClass="AppBundle\Repository\RecipeRepository") */ class Recipe { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column