<?php
namespace App\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* Require ROLE_ADMIN for *every* controller method in this class.
* @Route("/admin")
* @IsGranted("ROLE_ADMIN")
*/
class AdminController extends AbstractController
{
/**
* @Route("/", name="admin_index")
*/
public function adminDashboard(): Response
{
/* return $this->render('admin/index.html.twig', [
'controller_name' => 'AdminController',
]);*/
return $this->redirectToRoute('product_index');
}
/**
* @return Response
* @Route("/admin/get_product_select2", name="admin_get_product_select2")
*
*/
public function getProductAjax():Response
{
return $this->json();
}
}