123456789101112131415161718192021 |
- <?php
- class ProfileRoute implements IRoute {
- public static function getInstance() {
- return new ProfileRoute(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 - Profile"
- );
- return $this->view->render("profile.php", $viewData);
- }
- }
|