29 lines
842 B
PHP
29 lines
842 B
PHP
<?php
|
|
|
|
namespace App\Controller\Admin\System\Training;
|
|
|
|
use App\Repository\TrainingRepository;
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
|
|
class IndexController extends AbstractController
|
|
{
|
|
public function __construct(private readonly TrainingRepository $trainingRepository)
|
|
{}
|
|
|
|
#[Route('/admin/system/training', name: 'app_admin_system_training_index')]
|
|
#[IsGranted('ROLE_ADMIN')]
|
|
public function index(): Response
|
|
{
|
|
$trainings = $this
|
|
->trainingRepository
|
|
->getList()
|
|
;
|
|
|
|
return $this->render('admin/system/training/index.html.twig', [
|
|
'trainings' => $trainings,
|
|
]);
|
|
}
|
|
} |