Пример #1
0
 /**
  * Render the index page.
  *
  * @param Request $request
  *
  * @return Response
  */
 public function indexAction(Request $request)
 {
     $response = $this->pageAction($request, 'Index');
     if ($response->isNotModified($request)) {
         return $response;
     }
     $nextEvent = $this->eventRepo->getNextEvent();
     $data = array('page' => $this->reader->getPage('Index.md'), 'path' => 'Index', 'sponsors' => $this->reader->getPage('Sponsoren/Index.md'));
     if ($nextEvent->isDefined()) {
         /* @var Event $event */
         $event = $nextEvent->get();
         if (Carbon::createFromTimestamp($event->getRegistrationEnd()->getTimestamp())->isFuture()) {
             $data['nextEvent'] = $nextEvent;
         }
     }
     return $this->renderer->renderResponse('BCRMWebBundle:Web:index.html.twig', $data, $response);
 }
Пример #2
0
 /**
  * @return Response
  * @Template()
  */
 public function participantListAction()
 {
     $event = $this->eventRepo->getNextEvent()->getOrThrow(new AccessDeniedHttpException('No event.'));
     $participants = $this->registrationRepo->getParticipantList($event);
     return array('participants' => $participants, 'sponsors' => $this->reader->getPage('Sponsoren/Index.md'));
 }