src/AppBundle/Controller/ProgramsController.php line 23

Open in your IDE?
  1. <?php
  2. namespace AppBundle\Controller;
  3. use Pimcore\Controller\FrontendController;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Zend\Paginator\Paginator;
  7. use Pimcore\Model\DataObject;
  8. use Pimcore\Model\DataObject\Programs;
  9. class ProgramsController extends FrontendController
  10. {
  11.     
  12.     public function programsItemAction(Request $request)
  13.     {
  14.         $docPath $request->getPathInfo();
  15.         $object Programs::getByPath($docPath);
  16.         if (!$object instanceof Programs || !$object->isPublished()) {
  17.             // this will trigger a 404 error response
  18.             throw $this->createNotFoundException('Invalid request');
  19.         }
  20.         $this->view->program $object;
  21.     }
  22.     
  23. }