Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
UrlInterface Interface Reference
Inheritance diagram for UrlInterface:
UrlInterface Url Url Url

Public Member Functions

 getUseSession ()
 
 getBaseUrl ($params=[])
 
 getCurrentUrl ()
 
 getRouteUrl ($routePath=null, $routeParams=null)
 
 addSessionParam ()
 
 addQueryParams (array $data)
 
 setQueryParam ($key, $data)
 
 getUrl ($routePath=null, $routeParams=null)
 
 escape ($value)
 
 getDirectUrl ($url, $params=[])
 
 sessionUrlVar ($html)
 
 isOwnOriginUrl ()
 
 getRedirectUrl ($url)
 
 setScope ($params)
 

Data Fields

const URL_TYPE_LINK = 'link'
 
const URL_TYPE_DIRECT_LINK = 'direct_link'
 
const URL_TYPE_WEB = 'web'
 
const URL_TYPE_MEDIA = 'media'
 
const URL_TYPE_STATIC = 'static'
 
const URL_TYPE_JS = 'js'
 
const DEFAULT_URL_TYPE = 'link'
 
const DEFAULT_CONTROLLER_NAME = 'index'
 
const DEFAULT_ACTION_NAME = 'index'
 
const REWRITE_REQUEST_PATH_ALIAS = 'rewrite_request_path'
 
const SESSION_NAMESPACE = 'frontend'
 

Detailed Description

@api

Since
100.0.2

Definition at line 12 of file UrlInterface.php.

Member Function Documentation

◆ addQueryParams()

addQueryParams ( array  $data)

Add query parameters

Parameters
array$data
Returns
\Magento\Framework\UrlInterface

Implemented in Url.

◆ addSessionParam()

addSessionParam ( )

Add session param

Returns
\Magento\Framework\UrlInterface

Implemented in Url.

◆ escape()

escape (   $value)

Escape (enclosure) URL string

Parameters
string$value
Returns
string

Implemented in Url.

◆ getBaseUrl()

getBaseUrl (   $params = [])

Retrieve Base URL

Parameters
array$params
Returns
string

Implemented in Url.

◆ getCurrentUrl()

getCurrentUrl ( )

Retrieve current url with port number (if not default used)

Returns
string

Implemented in Url.

◆ getDirectUrl()

getDirectUrl (   $url,
  $params = [] 
)

Build url by direct url and parameters

Parameters
string$url
array$params
Returns
string

Implemented in Url.

◆ getRedirectUrl()

getRedirectUrl (   $url)

Return frontend redirect URL with SID and other session parameters if any

Parameters
string$url
Returns
string

Implemented in Url.

◆ getRouteUrl()

getRouteUrl (   $routePath = null,
  $routeParams = null 
)

Retrieve route URL

Parameters
string$routePath
array$routeParams
Returns
string

Implemented in Url.

◆ getUrl()

getUrl (   $routePath = null,
  $routeParams = null 
)

Build url by requested path and parameters

Parameters
string | null$routePath
array | null$routeParams
Returns
string

Implemented in Url, and Url.

◆ getUseSession()

getUseSession ( )

Retrieve use session rule

Returns
bool @SuppressWarnings(PHPMD.BooleanGetMethodName)

Implemented in Url.

◆ isOwnOriginUrl()

isOwnOriginUrl ( )

Check if users originated URL is one of the domain URLs assigned to stores

Returns
boolean

Implemented in Url.

◆ sessionUrlVar()

sessionUrlVar (   $html)

Replace Session ID value in URL

Parameters
string$html
Returns
string

Implemented in Url.

◆ setQueryParam()

setQueryParam (   $key,
  $data 
)

Set query param

Parameters
string$key
mixed$data
Returns
\Magento\Framework\UrlInterface

Implemented in Url.

◆ setScope()

setScope (   $params)

Set scope entity

Parameters
mixed$params
Returns
\Magento\Framework\UrlInterface

Implemented in Url.

Field Documentation

◆ DEFAULT_ACTION_NAME

const DEFAULT_ACTION_NAME = 'index'

Default action name

Definition at line 40 of file UrlInterface.php.

◆ DEFAULT_CONTROLLER_NAME

const DEFAULT_CONTROLLER_NAME = 'index'

Default controller name

Definition at line 35 of file UrlInterface.php.

◆ DEFAULT_URL_TYPE

const DEFAULT_URL_TYPE = 'link'

#- Default url type

Equals to self::URL_TYPE_LINK

Definition at line 30 of file UrlInterface.php.

◆ REWRITE_REQUEST_PATH_ALIAS

const REWRITE_REQUEST_PATH_ALIAS = 'rewrite_request_path'

Rewrite request path alias

Definition at line 45 of file UrlInterface.php.

◆ SESSION_NAMESPACE

const SESSION_NAMESPACE = 'frontend'

Session namespace to refer in other places

Definition at line 50 of file UrlInterface.php.

◆ URL_TYPE_DIRECT_LINK

const URL_TYPE_DIRECT_LINK = 'direct_link'

Definition at line 18 of file UrlInterface.php.

◆ URL_TYPE_JS

const URL_TYPE_JS = 'js'

Definition at line 22 of file UrlInterface.php.

◆ URL_TYPE_LINK

const URL_TYPE_LINK = 'link'

#+ Possible URL types

Definition at line 17 of file UrlInterface.php.

◆ URL_TYPE_MEDIA

const URL_TYPE_MEDIA = 'media'

Definition at line 20 of file UrlInterface.php.

◆ URL_TYPE_STATIC

const URL_TYPE_STATIC = 'static'

Definition at line 21 of file UrlInterface.php.

◆ URL_TYPE_WEB

const URL_TYPE_WEB = 'web'

Definition at line 19 of file UrlInterface.php.


The documentation for this interface was generated from the following file: