Sfoglia il codice sorgente

Listes : redirection de l'action show vers le edit

reduction
Guillaume 4 anni fa
parent
commit
1bcb39a1fd
1 ha cambiato i file con 13 aggiunte e 2 eliminazioni
  1. +13
    -2
      ShopBundle/Controller/Admin/AdminController.php

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

@@ -2,8 +2,10 @@

namespace Lc\ShopBundle\Controller\Admin;

use App\Entity\PointSale;
use App\Entity\ProductCategory;
use Doctrine\DBAL\Types\TextType;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController;
use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents;
@@ -33,14 +35,23 @@ class AdminController extends EasyAdminController
protected $security;
protected $userManager;


public function __construct(Security $security, UserManagerInterface $userManager)
{
$this->security = $security;
$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)
{

Loading…
Annulla
Salva