public function showAction($slug)
    {
        $securityContext = $this->container->get('security.authorization_checker');
        $question        = $this->getQuestionRepository()->findOneBySlug($slug);

        if (!$question || (!$question->isPublic() && !$securityContext->isGranted('ROLE_EDITOR'))) {
            throw $this->createNotFoundException('question not found');
        }

        return $this->render(
            'GenjFaqBundle:Question:show.html.twig',
            array(
                'question' => $question
            )
        );
    }
public function showAction($slug)
    {
        $securityContext = $this->container->get('security.authorization_checker');
        $question        = $this->getQuestionRepository()->findOneBySlug($slug);

        if (!$question || (!$question->isPublic() && !$securityContext->isGranted('ROLE_EDITOR'))) {
            throw $this->createNotFoundException('question not found');
        }

        return $this->render(
            'GenjFaqBundle:Question:show.html.twig',
            array(
                'question' => $question
            )
        );
    }
public function showAction ( $ slug ) { $ securityContext = $ this -> container -> get ( 'security.authorization_checker' ) ; $ question = $ this -> getQuestionRepository ( ) -> findOneBySlug ( $ slug ) ; if ( ! $ question || ( ! $ question -> isPublic ( ) && ! $ securityContext -> isGranted ( 'ROLE_EDITOR' ) ) ) { throw $ this -> createNotFoundException ( 'question not found' ) ; } return $ this -> render ( 'GenjFaqBundle:Question:show.html.twig' , array ( 'question' => $ question ) ) ; }
shows question if active

@param string $slug

@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
@return \Symfony\Component\HttpFoundation\Response
shows question if active