コード例 #1
0
 /**
  * Get the routes from the Joppa system combined with the routes from the fallback router
  * @return array Array with the route as key and a Route object as value
  */
 public function getRoutes()
 {
     $model = ModelManager::getInstance()->getModel(NodeModel::NAME);
     $routes = $model->getNodeRoutes();
     foreach ($routes as $route) {
         $routes[$route] = new Route($route, self::FRONTEND_CONTROLLER);
     }
     return Structure::merge(parent::getRoutes(), $routes);
 }
コード例 #2
0
 /**
  * Get the full query of the request
  * @return string
  */
 protected function getQuery()
 {
     $query = parent::getQuery();
     $tokens = explode(Request::QUERY_SEPARATOR, $query, 2);
     if (!$tokens) {
         return $query;
     }
     $i18n = I18n::getInstance();
     if ($i18n->hasLocale($tokens[0])) {
         $locale = $i18n->getLocale($tokens[0]);
         $i18n->setCurrentLocale($locale);
         if (array_key_exists(1, $tokens)) {
             $query = $tokens[1];
         } else {
             $query = '';
         }
     }
     return $query;
 }