src/Controller/CompanyController.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Company;
  4. use APY\BreadcrumbTrailBundle\Annotation\Breadcrumb;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. #[Route('/companies'name'app_company_')]
  9. #[Breadcrumb(title'Instruments'routeName'app_instrument_index')]
  10. //#[Breadcrumb(title: 'Marques', routeName: 'app_company_index')]/**/
  11. class CompanyController extends AbstractController
  12. {
  13.     #[Route('/'name'index')]
  14.     public function index(): Response
  15.     {
  16.         return $this->render('company/index.html.twig', [
  17.             'controller_name' => 'CompanyController',
  18.         ]);
  19.     }
  20.     #[Route('/{slug}'name'show')]
  21.     #[Breadcrumb(
  22.         title'{company.name}',
  23.         routeName'app_company_show',
  24.         routeParameters: ['slug' => '{company.slug}']
  25.     )]
  26.     public function show(Company $company): Response
  27.     {
  28.         return $this->render('company/show.html.twig', [
  29.             'company' => $company,
  30.         ]);
  31.     }
  32. }