Added document view support

This commit is contained in:
Polonkai Gergely
2012-07-17 09:21:33 +02:00
parent aa453242df
commit b173b9a9bb
5 changed files with 65 additions and 3 deletions

View File

@@ -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,
);
}
}