add a "view page" for event

ref #3
This commit is contained in:
2016-03-22 21:18:32 +01:00
parent 4d02314770
commit 90cbb78621
8 changed files with 94 additions and 36 deletions

View File

@@ -91,21 +91,21 @@ class EventController extends Controller
* Finds and displays a Event entity.
*
*/
public function showAction($id)
public function showAction($event_id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Event')->find($id);
$entity = $em->getRepository('ChillEventBundle:Event')->find($event_id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Event entity.');
}
$deleteForm = $this->createDeleteForm($id);
$this->denyAccessUnlessGranted('CHILL_EVENT_SEE_DETAILS', $entity,
"You are not allowed to see details on this event");
return $this->render('ChillEventBundle:Event:show.html.twig', array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
'event' => $entity
));
}