class URL

Constants

PATH_TO_FILE

WITH_INDEX_PAGE

Methods

__construct( ContainerInterface $container = null)

No description

setRequestContext( RequestContext $requestContext)

No description

static  URL
getInstance()

Return this class instance, only once instanciated.

string
getBaseUrl( bool $scheme_only = false)

Return the base URL, either the baseurl defined in Config, or the URL of the current language, if 'onedomainforeachlang' is enabled.

string
getIndexPage()

No description

string
absoluteUrl( string $path, array $parameters = null, boolean $path_only = self::WITH_INDEX_PAGE)

Returns the Absolute URL for a given path relative to web root. By default, the script name (indexdev.php) is added to the URL in devenvironment, use $path_only = true to get a path without the index script.

string
adminViewUrl( string $viewName, array $parameters = array())

Returns the Absolute URL to a administration view

string
viewUrl( string $viewName, array $parameters = array())

Returns the Absolute URL to a view

retrieve($view, $viewId, $viewLocale)

Retrieve a rewritten URL from a view, a view id and a locale

retrieveCurrent( Request $request)

Retrieve a rewritten URL from the current GET parameters

resolve($url)

Retrieve a rewritten URL from the current GET parameters or use toString method

static 
checkUrl($url, array $protocols = array('http', 'https'))

No description

Details

at line 43
__construct( ContainerInterface $container = null)

Parameters

ContainerInterface $container

at line 62
setRequestContext( RequestContext $requestContext)

Parameters

RequestContext $requestContext

at line 73
static URL getInstance()

Return this class instance, only once instanciated.

Return Value

URL the instance.

Exceptions

RuntimeException if the class has not been instanciated.

at line 89
string getBaseUrl( bool $scheme_only = false)

Return the base URL, either the baseurl defined in Config, or the URL of the current language, if 'onedomainforeachlang' is enabled.

Parameters

bool $scheme_only if true, only the scheme will be returned. If false, the complete base URL, including path, is returned.

Return Value

string the base URL, with a trailing '/'

at line 116
string getIndexPage()

Return Value

string the index page, which is in fact the base URL.

at line 133
string absoluteUrl( string $path, array $parameters = null, boolean $path_only = self::WITH_INDEX_PAGE)

Returns the Absolute URL for a given path relative to web root. By default, the script name (indexdev.php) is added to the URL in devenvironment, use $path_only = true to get a path without the index script.

Parameters

string $path the relative path
array $parameters An array of parameters
boolean $path_only if true (PATHTOFILE), getIndexPage() will not be added

Return Value

string The generated URL

at line 209
string adminViewUrl( string $viewName, array $parameters = array())

Returns the Absolute URL to a administration view

Parameters

string $viewName the view name (e.g. login for login.html)
array $parameters An array of parameters

Return Value

string The generated URL

at line 224
string viewUrl( string $viewName, array $parameters = array())

Returns the Absolute URL to a view

Parameters

string $viewName the view name (e.g. login for login.html)
array $parameters An array of parameters

Return Value

string The generated URL

at line 240
RewritingRetriever retrieve($view, $viewId, $viewLocale)

Retrieve a rewritten URL from a view, a view id and a locale

Parameters

$view
$viewId
$viewLocale

Return Value

RewritingRetriever You can access $url and $rewrittenUrl properties

at line 264
RewritingRetriever retrieveCurrent( Request $request)

Retrieve a rewritten URL from the current GET parameters

Parameters

Request $request

Return Value

RewritingRetriever You can access $url and $rewrittenUrl properties or use toString method

at line 306
RewritingResolver resolve($url)

Retrieve a rewritten URL from the current GET parameters or use toString method

Parameters

$url

Return Value

RewritingResolver

at line 332
static checkUrl($url, array $protocols = array('http', 'https'))

Parameters

$url
array $protocols