コード例 #1
0
ファイル: json.php プロジェクト: daodaoliang/nooku-framework
 /**
  * Force the route to fully qualified and not escaped by default
  *
  * @param   string|array    $route   The query string used to create the route
  * @param   boolean         $fqr     If TRUE create a fully qualified route. Default TRUE.
  * @param   boolean         $escape  If TRUE escapes the route for xml compliance. Default FALSE.
  * @return  KDispatcherRouterRoute The route
  */
 public function getRoute($route = '', $fqr = true, $escape = false)
 {
     return parent::getRoute($route, $fqr, $escape);
 }
コード例 #2
0
 /**
  * Creates a route based on a full or partial query string.
  *
  * This function adds the layout information to the route if a layout has been set
  *
  * @param string|array $route   The query string used to create the route
  * @param boolean $fqr          If TRUE create a fully qualified route. Default TRUE.
  * @param boolean $escape       If TRUE escapes the route for xml compliance. Default TRUE.
  * @return  KDispatcherRouterRoute The route
  */
 public function getRoute($route = '', $fqr = true, $escape = true)
 {
     if (is_string($route)) {
         parse_str(trim($route), $parts);
     } else {
         $parts = $route;
     }
     //Check to see if there is component information in the route if not add it
     if (!isset($parts['component'])) {
         $parts['component'] = $this->getIdentifier()->package;
     }
     //Add the view information to the route if it's not set
     if (!isset($parts['view'])) {
         $parts['view'] = $this->getName();
     }
     if (!isset($parts['layout']) && !empty($this->_layout)) {
         if ($parts['component'] == $this->getIdentifier()->package && $parts['view'] == $this->getName()) {
             $parts['layout'] = $this->getLayout();
         }
     }
     return parent::getRoute($parts, $fqr, $escape);
 }