Example #1
0
 /**
  * Autoloads the URL map only allowing a single execution.
  * @return array Returns the URL map.
  */
 protected function getRouterObject()
 {
     if (self::$routerObj !== null) {
         return self::$routerObj;
     }
     /*
      * Load up each route rule
      */
     $router = new RainRouter();
     foreach ($this->getUrlMap() as $pageInfo) {
         $router->route($pageInfo['file'], $pageInfo['pattern']);
     }
     /*
      * Sort all the rules
      */
     $router->sortRules();
     return self::$routerObj = $router;
 }