123456789101112131415161718192021 |
- <?php
- class DashboardRoute implements IRoute {
- public static function getInstance() {
- return new DashboardRoute(new View(), Authorizer::getInstance());
- }
- private $view;
- private $authorizer;
- private function __construct(View $view, Authorizer $authorizer) {
- $this->view = $view;
- $this->authorizer = $authorizer;
- }
- public function run(Url $url) {
- $this->authorizer->rejectIfNotAuthorized();
- $viewData = array(
- "url" => $url,
- "isLoggedIn" => true,
- "title" => "Browser Game - Dashboard"
- );
- return $this->view->render("dashboard.php", $viewData);
- }
- }
|