Networking\InitCmsBundle\Controller\PageAdminController::showAction PHP Method

showAction() public method

public showAction ( null $id = null ) : Response
$id null
return Symfony\Component\HttpFoundation\Response
    public function showAction($id = null)
    {
        /** @var Request $request */
        $request = $this->get('request_stack')->getCurrentRequest();
        $id = $request->get($this->admin->getIdParameter());
        $object = $this->admin->getObject($id);
        if (!$object) {
            throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
        }
        if (false === $this->admin->isGranted('VIEW', $object)) {
            throw new AccessDeniedException();
        }
        $this->admin->setSubject($object);
        return $this->render($this->admin->getTemplate('show'), array('action' => 'show', 'object' => $object, 'elements' => $this->admin->getShow()));
    }