Пример #1
0
 public function index() : View
 {
     $service = new ConferenceService($this->dbContext);
     $allConferences = $service->getAll();
     $allConferences = array_slice($allConferences, 0, 6);
     return new View('Home', 'Index', $allConferences);
 }
 /**
  * @Authorize
  * @Route("Me/Conferences")
  */
 public function myConferences() : View
 {
     $service = new ConferenceService($this->dbContext);
     if ($this->identity->isInRole("Admin")) {
         $conferences = $service->getAll();
     } else {
         $conferences = $service->myConferences();
     }
     return new View('Conference', 'MyConferences', $conferences);
 }