/** * Fetches an instance of the router library, initializing if necessary. * * @param string $controllerPath Path where controllers are located. * @return RPG_Router */ public static function router($controllerPath = '') { if (self::$_router === null) { if (empty($controllerPath)) { throw new RPG_Exception('Controller path cannot be empty on first call to RPG::router()'); } self::$_router = RPG_Router::getInstance(); self::$_router->setControllerPath($controllerPath); } return self::$_router; }