<?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;
class AdminLTEController extends AbstractController
{
/**
*
* @IsGranted("ROLE_ADMIN", message="Only Admin!")
*
* @Route("/dashboard", name="dashboard")
*/
public function index() {
return $this->redirectToRoute('vehicle_index');
// return $this->render('dashboard/index.html.twig', [
// 'controller_name' => 'AdminLTEController',
// ]);
}
/**
*
* @Route("/", name="main_index_action")
*/
public function main_index_action() {
if ($this->isGranted('IS_AUTHENTICATED_FULLY')){
return $this->redirectToRoute('vehicle_index');
}
return $this->redirectToRoute('app_login');
// return new Response($this->render('statuses/403.html.twig', []), 403);
}
}