. */ namespace App\Controller; use App\DataTables\ProjectBomEntriesDataTable; use App\Entity\ProjectSystem\Project; use Omines\DataTablesBundle\DataTableFactory; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; /** * @Route("/project") */ class ProjectController extends AbstractController { private DataTableFactory $dataTableFactory; public function __construct(DataTableFactory $dataTableFactory) { $this->dataTableFactory = $dataTableFactory; } /** * @Route("/{id}", name="project_info") */ public function info(Project $project, Request $request) { $this->denyAccessUnlessGranted('read', $project); $table = $this->dataTableFactory->createFromType(ProjectBomEntriesDataTable::class, ['project' => $project]) ->handleRequest($request); if ($table->isCallback()) { return $table->getResponse(); } return $this->render('Projects/info.html.twig', [ 'datatable' => $table, 'project' => $project, ]); } }