Browse Source

Listes : redirection de l'action show vers le edit

reduction
Guillaume 4 years ago
parent
commit
1bcb39a1fd
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      ShopBundle/Controller/Admin/AdminController.php

+ 13
- 2
ShopBundle/Controller/Admin/AdminController.php View File



namespace Lc\ShopBundle\Controller\Admin; namespace Lc\ShopBundle\Controller\Admin;


use App\Entity\PointSale;
use App\Entity\ProductCategory; use App\Entity\ProductCategory;
use Doctrine\DBAL\Types\TextType; use Doctrine\DBAL\Types\TextType;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController; use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController;
use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents; use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents;
protected $security; protected $security;
protected $userManager; protected $userManager;



public function __construct(Security $security, UserManagerInterface $userManager) public function __construct(Security $security, UserManagerInterface $userManager)
{ {
$this->security = $security; $this->security = $security;
$this->userManager = $userManager; $this->userManager = $userManager;

} }


public function showAction()
{
$id = $this->request->query->get('id');
$entity = $this->request->query->get('entity');

return $this->redirectToRoute('easyadmin', [
'action' => 'edit',
'entity' => $entity,
'id' => $id
]) ;
}


protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null) protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)
{ {

Loading…
Cancel
Save