src/AppBundle/Controller/ThemeController.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  *
  4.  * Copyright (c) 2017. The Cocktail
  5.  *
  6.  * This file is part of the Movistar Originales package.
  7.  *
  8.  */
  9. namespace AppBundle\Controller;
  10. use eZ\Bundle\EzPublishCoreBundle\Controller;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  13. class ThemeController extends Controller
  14. {
  15.     public function notAccesibleAction(Request $request)
  16.     {
  17.         throw new NotFoundHttpException('Not accesible content');
  18.     }
  19.     public function faviconAction($contentId)
  20.     {
  21.         $contentService $this->get('ezpublish.api.service.content');
  22.         $rootContent $contentService->loadContent($contentId);
  23.         return $this->render(':content:_favicon.html.twig', ['content' => $rootContent ]);
  24.     }
  25.     public function redirectAction(Request $request$path$site)
  26.     {
  27.         $siteAccess $request->attributes->get('siteaccess');
  28.         if ($siteAccess->name !== $site) {
  29.             throw new NotFoundHttpException('Page not found');
  30.         }
  31.         return $this->redirect($path301);
  32.     }
  33. }