PHP Класс Frontend\Core\Engine\Url

Наследование: extends KernelLoader
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Приватные методы

Метод Описание
processQueryString ( ) Process the query string
setPages ( array $pages = [] ) Set the pages
setParameters ( array $parameters = [] ) Set the parameters

Описание методов

__construct() публичный метод

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

getDomain() публичный метод

Get the domain
public getDomain ( ) : string
Результат string The current domain (without www.)

getHost() публичный метод

Get the host
Устаревший: use $request->getHttpHost() instead
public getHost ( ) : string
Результат string

getPage() публичный метод

Get a page specified by the given index
public getPage ( integer $index ) : mixed
$index integer The index (0-based).
Результат mixed

getPages() публичный метод

Return all the pages
public getPages ( ) : array
Результат array

getParameter() публичный метод

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.
Результат mixed

getParameters() публичный метод

Return all the parameters
public getParameters ( boolean $includeGET = true ) : array
$includeGET boolean Should the GET-parameters be included?
Результат array

getQueryString() публичный метод

Get the query string
public getQueryString ( ) : string
Результат string

hasParameter() публичный метод

Check if a certain ($_GET) parameter exists
public hasParameter ( mixed $index ) : boolean
$index mixed The index of the parameter.
Результат boolean