/** * Initalize the Router * match and execute current Route */ public function initialize() { $lstrRequestedUri = preg_replace('|' . dirname($_SERVER['PHP_SELF']) . '|i', '', $_SERVER['REQUEST_URI']); $loRoute = Router::getInstance()->match($lstrRequestedUri); $this->executeRoute($loRoute); }
<?php use Libraries\Router; Router::getInstance()->map('/', array('template' => 'resume.php', 'controller' => 'Resume', 'method' => 'show'));