src/Controller/DocumentationController.php line 29

  1. <?php
  2. namespace App\Controller;
  3. use App\Globals\Roles;
  4. use App\Globals\Triggers;
  5. use App\Utility\EmailUtility;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
  9. use Symfony\Contracts\Translation\TranslatorInterface;
  10. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  11. use Symfony\Component\HttpFoundation\Request;
  12. class DocumentationController extends AbstractController
  13. {
  14.     /**
  15.      * @var \Symfony\Component\Translation\Translator
  16.      */
  17.     protected $translator;
  18.     public function __construct(TranslatorInterface $translator) {
  19.         $this->translator $translator;
  20.     }
  21.     /**
  22.      * @Route("/documentation/{service}", name="app_documentation_index", defaults={"service"=null})
  23.      */
  24.     public function index(Request $request$service) {
  25.         if(is_null($service)) {
  26.             return $this->render('documentation/index.twig');
  27.         }
  28.         else {
  29.             return $this->render('documentation/'.$service.'.twig', array(
  30.                 'service' => $service
  31.                 ));
  32.         }
  33.     }
  34. }