private function routeCommand($request) { $command = $request->shiftCommand(); if (empty($command)) { $command = 'Student'; } $className = 'tailgate\\Controller\\User\\' . $command; if (!class_exists($className)) { \Server::pageNotFound(); exit; } $commandObject = new $className($this->getModule()); return $commandObject; }
public function getHtmlView($data, \Request $request) { $command = $request->getVar('command'); switch ($command) { case 'confirm': $content = $this->confirmWinner(); break; default: echo \Server::pageNotFound(); exit; } $view = new \View\HtmlView($content); return $view; }
public function getHtmlView($data, \Request $request) { if (!$request->isVar('command')) { $command = 'landing'; } else { $command = $request->getVar('command'); } switch ($command) { case 'landing': $content = $this->landing(); break; default: echo \Server::pageNotFound(); exit; break; } $view = new \View\HtmlView($content); return $view; }