PHP Class Frontend\Core\Engine\Url

Inheritance: extends KernelLoader
Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
getDomain ( ) : string Get the domain
getHost ( ) : string Get the host
getPage ( integer $index ) : mixed Get a page specified by the given index
getPages ( ) : array Return all the pages
getParameter ( mixed $index, string $type = 'string', mixed $defaultValue = null ) : mixed Get a parameter specified by the given index The function will return null if the key is not available By default we will cast the return value into a string, if you want something else specify it by passing the wanted type.
getParameters ( boolean $includeGET = true ) : array Return all the parameters
getQueryString ( ) : string Get the query string
hasParameter ( mixed $index ) : boolean Check if a certain ($_GET) parameter exists

Private Methods

Method Description
processQueryString ( ) Process the query string
setPages ( array $pages = [] ) Set the pages
setParameters ( array $parameters = [] ) Set the parameters

Method Details

__construct() public method

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface

getDomain() public method

Get the domain
public getDomain ( ) : string
return string The current domain (without www.)

getHost() public method

Get the host
Deprecation: use $request->getHttpHost() instead
public getHost ( ) : string
return string

getPage() public method

Get a page specified by the given index
public getPage ( integer $index ) : mixed
$index integer The index (0-based).
return mixed

getPages() public method

Return all the pages
public getPages ( ) : array
return array

getParameter() public method

Get a parameter specified by the given index The function will return null if the key is not available By default we will cast the return value into a string, if you want something else specify it by passing the wanted type.
public getParameter ( mixed $index, string $type = 'string', mixed $defaultValue = null ) : mixed
$index mixed The index of the parameter.
$type string The return type, possible values are: bool, boolean, int, integer, float, double, string, array.
$defaultValue mixed The value that should be returned if the key is not available.
return mixed

getParameters() public method

Return all the parameters
public getParameters ( boolean $includeGET = true ) : array
$includeGET boolean Should the GET-parameters be included?
return array

getQueryString() public method

Get the query string
public getQueryString ( ) : string
return string

hasParameter() public method

Check if a certain ($_GET) parameter exists
public hasParameter ( mixed $index ) : boolean
$index mixed The index of the parameter.
return boolean