API15

JRouter/build: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 60: Line 60:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=build
  category=build
  category=JRouter
  category=JRouter
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:05, 25 March 2017

Description

Function to convert an internal URI to a route

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

& build($url)
Parameter Name Default Value Description
$url $string The internal URL

Returns

string The absolute search engine friendly URL

Defined in

libraries/joomla/application/router.php

Importing

jimport( 'joomla.application.router' );

Source Body

function &build($url)
{
        //Create the URI object
        $uri =& $this->_createURI($url);

        //Process the uri information based on custom defined rules
        $this->_processBuildRules($uri);

        // Build RAW URL
        if($this->_mode == JROUTER_MODE_RAW) {
                $this->_buildRawRoute($uri);
        }

        // Build SEF URL : mysite/route/index.php?var=x
        if ($this->_mode == JROUTER_MODE_SEF) {
                $this->_buildSefRoute($uri);
        }

        return $uri;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples