public function queueAction($id, Request $request) { $event = $this->getDoctrine()->getRepository('ProdekoIlmoBundle:Event')->findOneBy(array('id' => $id)); //Jos ilmo on alkanut, ohjataan tapahtumasivulle if ($event->registrationOpen() || $event->registrationEnded()) { return $this->redirect($this->generateUrl('show', array('id' => $id))); } $registration = Helpers::createRegistrationObject($event); $form = $this->createForm(new RegistrationType($event), $registration); $variables = array('event' => $event, 'form' => $form->createView()); return $this->render('ProdekoIlmoBundle:Ilmo:queue.html.twig', $variables); }