Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class RootController extends URIController
- {
- function run()
- {
- UI::addNav('The Hive Workshop', '/');
- switch ($this->part)
- {
- case 'account':
- $c = new AccountController($this->rest);
- break;
- case 'test':
- $c = new TestController($this->rest);
- break;
- case 'scratch':
- $c = new ScratchController($this->rest);
- break;
- case 'members':
- case 'info':
- case 'import':
- $c = new UnknownURIController($this->rest);
- break;
- case 'admin':
- $c = new AdminController($this->rest);
- break;
- case '':
- // Display the front page
- $c = new FrontpageController($this->rest);
- break;
- default:
- $section = Section::fromUrl($this->part);
- if ($section)
- {
- $c = new SectionController($this->rest, $section);
- }
- else
- {
- $c = new UnknownURIController($this->rest);
- }
- break;
- }
- URIController::push($c)->run();
- }
- }
- ?>
Add Comment
Please, Sign In to add comment