Guest User

Untitled

a guest
Jan 12th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. <?php
  2.  
  3. class RootController extends URIController
  4. {
  5.   function run()
  6.   {
  7.     UI::addNav('The Hive Workshop', '/');
  8.    
  9.     switch ($this->part)
  10.     {
  11.       case 'account':
  12.         $c = new AccountController($this->rest);
  13.         break;
  14.      
  15.       case 'test':
  16.         $c = new TestController($this->rest);
  17.         break;
  18.        
  19.       case 'scratch':
  20.         $c = new ScratchController($this->rest);
  21.         break;
  22.      
  23.       case 'members':
  24.       case 'info':
  25.       case 'import':
  26.         $c = new UnknownURIController($this->rest);
  27.         break;
  28.      
  29.       case 'admin':
  30.         $c = new AdminController($this->rest);
  31.         break;
  32.        
  33.       case '':
  34.         // Display the front page
  35.         $c = new FrontpageController($this->rest);
  36.         break;
  37.      
  38.       default:
  39.         $section = Section::fromUrl($this->part);
  40.         if ($section)
  41.         {
  42.           $c = new SectionController($this->rest, $section);
  43.         }
  44.         else
  45.         {
  46.           $c = new UnknownURIController($this->rest);
  47.         }
  48.         break;
  49.     }
  50.     URIController::push($c)->run();
  51.   }
  52. }
  53.  
  54. ?>
Add Comment
Please, Sign In to add comment