public function getRoute($route = '', $fqr = true)
    {
        if (! is_array($route)) {
            $parts = array();
            parse_str(trim($route), $parts);
            $route = $parts;
        }

        $parts = $route;

        $route = array();

        //Check to see if there is component information in the route if not add it
        if (! isset($parts['option'])) {
            $route['option'] = 'com_'.$this->getIdentifier()->package;
        }

        //Add the view information to the route if it's not set
        if (! isset($parts['view'])) {
            $route['view'] = $this->getName();

            //Add the layout information to the route if it's not set
            if (! isset($parts['layout'])) {
                $route['layout'] = $this->getLayout();

                //@TODO temporary. who are we today what's the default layout
                if ($route['layout'] == 'default') {
                    unset($route['layout']);
                }
            }

            //since the view is missing then get the data from
            //the state
            $data = $this->_state->getData($this->_state->isUnique());

            $route = array_merge($route, $data);

            //Add the format information to the route only if it's not 'html'
            if (!isset($parts['format'])) {
                $route['format'] = $this->getIdentifier()->name;
            }
        }

        $parts = array_merge($route, $parts);
        $parts = http_build_query($parts);
        $route = $this->getService('com:application')->getRouter()->build($parts, $fqr);

        //if ($fqr) {
        //    $route->scheme = $this->getBaseUrl()->scheme;
        //    $route->host = $this->getBaseUrl()->host;
        //}

        return $route;
    }
public function getRoute($route = '', $fqr = true)
    {
        if (! is_array($route)) {
            $parts = array();
            parse_str(trim($route), $parts);
            $route = $parts;
        }

        $parts = $route;

        $route = array();

        //Check to see if there is component information in the route if not add it
        if (! isset($parts['option'])) {
            $route['option'] = 'com_'.$this->getIdentifier()->package;
        }

        //Add the view information to the route if it's not set
        if (! isset($parts['view'])) {
            $route['view'] = $this->getName();

            //Add the layout information to the route if it's not set
            if (! isset($parts['layout'])) {
                $route['layout'] = $this->getLayout();

                //@TODO temporary. who are we today what's the default layout
                if ($route['layout'] == 'default') {
                    unset($route['layout']);
                }
            }

            //since the view is missing then get the data from
            //the state
            $data = $this->_state->getData($this->_state->isUnique());

            $route = array_merge($route, $data);

            //Add the format information to the route only if it's not 'html'
            if (!isset($parts['format'])) {
                $route['format'] = $this->getIdentifier()->name;
            }
        }

        $parts = array_merge($route, $parts);
        $parts = http_build_query($parts);
        $route = $this->getService('com:application')->getRouter()->build($parts, $fqr);

        //if ($fqr) {
        //    $route->scheme = $this->getBaseUrl()->scheme;
        //    $route->host = $this->getBaseUrl()->host;
        //}

        return $route;
    }
public function getRoute ( $ route = '' , $ fqr = true ) { if ( ! is_array ( $ route ) ) { $ parts = array ( ) ; parse_str ( trim ( $ route ) , $ parts ) ; $ route = $ parts ; } $ parts = $ route ; $ route = array ( ) ; //Check to see if there is component information in the route if not add it if ( ! isset ( $ parts [ 'option' ] ) ) { $ route [ 'option' ] = 'com_' . $ this -> getIdentifier ( ) -> package ; } //Add the view information to the route if it's not set if ( ! isset ( $ parts [ 'view' ] ) ) { $ route [ 'view' ] = $ this -> getName ( ) ; //Add the layout information to the route if it's not set if ( ! isset ( $ parts [ 'layout' ] ) ) { $ route [ 'layout' ] = $ this -> getLayout ( ) ; //@TODO temporary. who are we today what's the default layout if ( $ route [ 'layout' ] == 'default' ) { unset ( $ route [ 'layout' ] ) ; } } //since the view is missing then get the data from //the state $ data = $ this -> _state -> getData ( $ this -> _state -> isUnique ( ) ) ; $ route = array_merge ( $ route , $ data ) ; //Add the format information to the route only if it's not 'html' if ( ! isset ( $ parts [ 'format' ] ) ) { $ route [ 'format' ] = $ this -> getIdentifier ( ) -> name ; } } $ parts = array_merge ( $ route , $ parts ) ; $ parts = http_build_query ( $ parts ) ; $ route = $ this -> getService ( 'com:application' ) -> getRouter ( ) -> build ( $ parts , $ fqr ) ; //if ($fqr) { //    $route->scheme = $this->getBaseUrl()->scheme; //    $route->host = $this->getBaseUrl()->host; //} return $ route ; }
Get a route based on a full or partial query string.

option, view and layout can be ommitted. The following variations
will all result in the same route

- foo=bar
- option=com_mycomp&view=myview&foo=bar

In templates, use @route()

@todo refactor this method and LibApplicationRouter::getRoute

@param	string	The query string used to create the route
@param 	bool	If TRUE create a fully qualified route. Default TRUE.

@return string The route
Get a route based on a full or partial query string .