| Magento 2 Documentation
    2.3
    Documentation for Magento 2 CMS v2.3 (December 2018) | 
 
  
| Public Member Functions | |
| __construct (\Magento\Framework\App\Route\ConfigInterface $routeConfig, \Magento\Framework\App\RequestInterface $request, \Magento\Framework\Url\SecurityInfoInterface $urlSecurityInfo, \Magento\Framework\Url\ScopeResolverInterface $scopeResolver, \Magento\Framework\Session\Generic $session, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory, \Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Url\RouteParamsPreprocessorInterface $routeParamsPreprocessor, $scopeType, array $data=[], HostChecker $hostChecker=null, Json $serializer=null) | |
| setUseSession ($useSession) | |
| getUseSession () | |
| getConfigData ($key, $prefix=null) | |
| setRequest (\Magento\Framework\App\RequestInterface $request) | |
| setScope ($params) | |
| getBaseUrl ($params=[]) | |
| getRouteUrl ($routePath=null, $routeParams=null) | |
| addSessionParam () | |
| addQueryParams (array $data) | |
| setQueryParam ($key, $data) | |
| getUrl ($routePath=null, $routeParams=null) | |
| getRebuiltUrl ($url) | |
| escape ($value) | |
| getDirectUrl ($url, $params=[]) | |
| sessionUrlVar ($html) | |
| useSessionIdForUrl ($secure=false) | |
| isOwnOriginUrl () | |
| getRedirectUrl ($url) | |
| getCurrentUrl () | |
|  Public Member Functions inherited from DataObject | |
| __construct (array $data=[]) | |
| addData (array $arr) | |
| setData ($key, $value=null) | |
| unsetData ($key=null) | |
| getData ($key='', $index=null) | |
| getDataByPath ($path) | |
| getDataByKey ($key) | |
| setDataUsingMethod ($key, $args=[]) | |
| getDataUsingMethod ($key, $args=null) | |
| hasData ($key='') | |
| toArray (array $keys=[]) | |
| convertToArray (array $keys=[]) | |
| toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
| convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
| toJson (array $keys=[]) | |
| convertToJson (array $keys=[]) | |
| toString ($format='') | |
| __call ($method, $args) | |
| isEmpty () | |
| serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
| debug ($data=null, &$objects=[]) | |
| offsetSet ($offset, $value) | |
| offsetExists ($offset) | |
| offsetUnset ($offset) | |
| offsetGet ($offset) | |
| Protected Member Functions | |
| _parseUrl ($url) | |
| _getConfigCacheId ($path) | |
| _getConfig ($path) | |
| _getRequest () | |
| _getType () | |
| _isSecure () | |
| _getScope () | |
| _setRoutePath ($data) | |
| _getActionPath () | |
| _getRoutePath ($routeParams=[]) | |
| _setRouteName ($data) | |
| _getRouteFrontName () | |
| _getRouteName ($default=null) | |
| _setControllerName ($data) | |
| _getControllerName ($default=null) | |
| _setActionName ($data) | |
| _getActionName ($default=null) | |
| _setRouteParams (array $data, $unsetOldParams=true) | |
| _getRouteParams () | |
| _setQuery ($data) | |
| _getQuery ($escape=false) | |
| _getFragment () | |
| _prepareSessionUrl ($url) | |
| getRouteParamsResolver () | |
|  Protected Member Functions inherited from DataObject | |
| _getData ($key) | |
| _underscore ($name) | |
| Protected Attributes | |
| $_reservedRouteParams | |
| $_scopeType | |
| $_request | |
| $_useSession | |
| $_urlSecurityInfo | |
| $_session | |
| $_sidResolver | |
| $_routeConfig | |
| $_scopeResolver | |
| $_queryParamsResolver | |
| $_scopeConfig | |
| $routeParamsPreprocessor | |
|  Protected Attributes inherited from DataObject | |
| $_data = [] | |
| Static Protected Attributes | |
| static | $_configDataCache | 
|  Static Protected Attributes inherited from DataObject | |
| static | $_underscoreCache = [] | 
| Additional Inherited Members | |
|  Data Fields inherited from UrlInterface | |
| 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' | 
URL
Properties:
@codingStandardsIgnoreStart URL structure:
https://user:password@host:443/base_path/[base_script][scopeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value::fragment __________A___________/____________________________________B_____________________________________/ __________________C___________________/ __________________D_________________/ _____E_____/ _____________F______________/ ___________________________G______________________/ ___________________________________________________H____________________________________________________/ @codingStandardsIgnoreEnd
| __construct | ( | \Magento\Framework\App\Route\ConfigInterface | $routeConfig, | 
| \Magento\Framework\App\RequestInterface | $request, | ||
| \Magento\Framework\Url\SecurityInfoInterface | $urlSecurityInfo, | ||
| \Magento\Framework\Url\ScopeResolverInterface | $scopeResolver, | ||
| \Magento\Framework\Session\Generic | $session, | ||
| \Magento\Framework\Session\SidResolverInterface | $sidResolver, | ||
| \Magento\Framework\Url\RouteParamsResolverFactory | $routeParamsResolverFactory, | ||
| \Magento\Framework\Url\QueryParamsResolverInterface | $queryParamsResolver, | ||
| \Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, | ||
| \Magento\Framework\Url\RouteParamsPreprocessorInterface | $routeParamsPreprocessor, | ||
| $scopeType, | |||
| array | $data = [], | ||
| HostChecker | $hostChecker = null, | ||
| Json | $serializer = null | ||
| ) | 
| \Magento\Framework\App\Route\ConfigInterface | $routeConfig | |
| \Magento\Framework\App\RequestInterface | $request | |
| \Magento\Framework\Url\SecurityInfoInterface | $urlSecurityInfo | |
| \Magento\Framework\Url\ScopeResolverInterface | $scopeResolver | |
| \Magento\Framework\Session\Generic | $session | |
| \Magento\Framework\Session\SidResolverInterface | $sidResolver | |
| \Magento\Framework\Url\RouteParamsResolverFactory | $routeParamsResolverFactory | |
| \Magento\Framework\Url\QueryParamsResolverInterface | $queryParamsResolver | |
| \Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
| \Magento\Framework\Url\RouteParamsPreprocessorInterface | $routeParamsPreprocessor | |
| string | $scopeType | |
| array | $data | |
| HostChecker | null | $hostChecker | |
| Json | null | $serializer | @SuppressWarnings(PHPMD.ExcessiveParameterList) | 
Definition at line 213 of file Url.php.
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
Set Controller Name
Reset action name and route path if has change
| string | $data | 
Definition at line 656 of file Url.php.
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| 
 | protected | 
| addQueryParams | ( | array | $data | ) | 
Add query Params as array
| array | $data | 
Implements UrlInterface.
Definition at line 801 of file Url.php.
| addSessionParam | ( | ) | 
Add session param
Implements UrlInterface.
Definition at line 764 of file Url.php.
| escape | ( | $value | ) | 
Escape (enclosure) URL string
| string | $value | 
Implements UrlInterface.
| getBaseUrl | ( | $params = [] | ) | 
Retrieve Base URL
| array | $params | 
Original Scope
Add availability support urls without scope code
Implements UrlInterface.
Definition at line 453 of file Url.php.
| getConfigData | ( | $key, | |
| $prefix = null | |||
| ) | 
| getCurrentUrl | ( | ) | 
Retrieve current url
Custom port
Implements UrlInterface.
Definition at line 1143 of file Url.php.
| getDirectUrl | ( | $url, | |
| $params = [] | |||
| ) | 
Build url by direct url and parameters
| string | $url | |
| array | $params | 
Implements UrlInterface.
Definition at line 1045 of file Url.php.
| getRebuiltUrl | ( | $url | ) | 
| getRedirectUrl | ( | $url | ) | 
Return frontend redirect URL with SID and other session parameters if any
| string | $url | 
Implements UrlInterface.
Definition at line 1127 of file Url.php.
| 
 | protected | 
| getRouteUrl | ( | $routePath = null, | |
| $routeParams = null | |||
| ) | 
Retrieve route URL
| string | $routePath | |
| array | $routeParams | 
Implements UrlInterface.
Definition at line 736 of file Url.php.
| getUrl | ( | $routePath = null, | |
| $routeParams = null | |||
| ) | 
Build and cache url by requested path and parameters
| string | null | $routePath | |
| array | null | $routeParams | 
Implements UrlInterface.
Definition at line 839 of file Url.php.
| getUseSession | ( | ) | 
Retrieve use session rule
Implements UrlInterface.
Definition at line 292 of file Url.php.
| isOwnOriginUrl | ( | ) | 
Check if users originated URL is one of the domain URLs assigned to scopes
Implements UrlInterface.
| sessionUrlVar | ( | $html | ) | 
Replace Session ID value in URL
| string | $html | 
Callback function for session replace
| array | $match | 
Implements UrlInterface.
Definition at line 1057 of file Url.php.
| setQueryParam | ( | $key, | |
| $data | |||
| ) | 
Set query param
| string | $key | |
| mixed | $data | 
Implements UrlInterface.
Definition at line 814 of file Url.php.
| setRequest | ( | \Magento\Framework\App\RequestInterface | $request | ) | 
| setScope | ( | $params | ) | 
Set scope entity
| mixed | $params | 
Implements UrlInterface.
Definition at line 427 of file Url.php.
| setUseSession | ( | $useSession | ) | 
| useSessionIdForUrl | ( | $secure = false | ) | 
| 
 | protected |