Added document view support
This commit is contained in:
@@ -195,4 +195,19 @@ class DefaultController extends Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/dokumentum/{documentSlug}", name="KekRozsakFrontBundle_documentView")
|
||||
* @Template()
|
||||
*/
|
||||
public function documentViewAction($documentSlug)
|
||||
{
|
||||
$docRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Document');
|
||||
if (!($document = $docRepo->findOneBySlug($documentSlug)))
|
||||
throw $this->createNotFoundException('A kért dokumentum nem létezik!');
|
||||
|
||||
return array(
|
||||
'document' => $document,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user