<?php
namespace AppBundle\Controller;
use Pimcore\Controller\FrontendController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Zend\Paginator\Paginator;
use Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Programs;
class ProgramsController extends FrontendController
{
public function programsItemAction(Request $request)
{
$docPath = $request->getPathInfo();
$object = Programs::getByPath($docPath);
if (!$object instanceof Programs || !$object->isPublished()) {
// this will trigger a 404 error response
throw $this->createNotFoundException('Invalid request');
}
$this->view->program = $object;
}
}