Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Url.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Framework;
8 
12 
67 {
73  protected static $_configDataCache;
74 
80  protected $_reservedRouteParams = [
81  '_scope',
82  '_type',
83  '_secure',
84  '_forced_secure',
85  '_use_rewrite',
86  '_nosid',
87  '_absolute',
88  '_current',
89  '_direct',
90  '_fragment',
91  '_escape',
92  '_query',
93  '_scope_to_url',
94  ];
95 
99  protected $_scopeType;
100 
106  protected $_request;
107 
113  protected $_useSession;
114 
120  protected $_urlSecurityInfo;
121 
125  protected $_session;
126 
130  protected $_sidResolver;
131 
137  protected $_routeConfig;
138 
142  private $_routeParamsResolver;
143 
147  private $_routeParamsResolverFactory;
148 
152  protected $_scopeResolver;
153 
158 
164  private $cacheUrl = [];
165 
169  protected $_scopeConfig;
170 
175 
179  private $urlModifier;
180 
184  private $escaper;
185 
189  private $hostChecker;
190 
194  private $serializer;
195 
213  public function __construct(
214  \Magento\Framework\App\Route\ConfigInterface $routeConfig,
215  \Magento\Framework\App\RequestInterface $request,
216  \Magento\Framework\Url\SecurityInfoInterface $urlSecurityInfo,
217  \Magento\Framework\Url\ScopeResolverInterface $scopeResolver,
218  \Magento\Framework\Session\Generic $session,
219  \Magento\Framework\Session\SidResolverInterface $sidResolver,
220  \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory,
221  \Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver,
222  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
223  \Magento\Framework\Url\RouteParamsPreprocessorInterface $routeParamsPreprocessor,
224  $scopeType,
225  array $data = [],
226  HostChecker $hostChecker = null,
227  Json $serializer = null
228  ) {
229  $this->_request = $request;
230  $this->_routeConfig = $routeConfig;
231  $this->_urlSecurityInfo = $urlSecurityInfo;
232  $this->_scopeResolver = $scopeResolver;
233  $this->_session = $session;
234  $this->_sidResolver = $sidResolver;
235  $this->_routeParamsResolverFactory = $routeParamsResolverFactory;
236  $this->_queryParamsResolver = $queryParamsResolver;
237  $this->_scopeConfig = $scopeConfig;
238  $this->routeParamsPreprocessor = $routeParamsPreprocessor;
239  $this->_scopeType = $scopeType;
240  $this->hostChecker = $hostChecker ?: \Magento\Framework\App\ObjectManager::getInstance()
241  ->get(HostChecker::class);
242  $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
243  parent::__construct($data);
244  }
245 
252  protected function _parseUrl($url)
253  {
254  $data = parse_url($url);
255  $parts = [
256  'scheme' => 'setScheme',
257  'host' => 'setHost',
258  'port' => 'setPort',
259  'user' => 'setUser',
260  'pass' => 'setPassword',
261  'path' => 'setPath',
262  'query' => '_setQuery',
263  'fragment' => 'setFragment',
264  ];
265 
266  foreach ($parts as $component => $method) {
267  if (isset($data[$component])) {
268  $this->{$method}($data[$component]);
269  }
270  }
271  return $this;
272  }
273 
280  public function setUseSession($useSession)
281  {
282  $this->_useSession = (bool) $useSession;
283  return $this;
284  }
285 
292  public function getUseSession()
293  {
294  if ($this->_useSession === null) {
295  $this->_useSession = $this->_sidResolver->getUseSessionInUrl();
296  }
297  return $this->_useSession;
298  }
299 
307  public function getConfigData($key, $prefix = null)
308  {
309  if ($prefix === null) {
310  $prefix = 'web/' . ($this->_isSecure() ? 'secure' : 'unsecure') . '/';
311  }
312  $path = $prefix . $key;
313 
314  $cacheId = $this->_getConfigCacheId($path);
315  if (!isset(self::$_configDataCache[$cacheId])) {
316  $data = $this->_getConfig($path);
317  self::$_configDataCache[$cacheId] = $data;
318  }
319 
320  return self::$_configDataCache[$cacheId];
321  }
322 
329  protected function _getConfigCacheId($path)
330  {
331  return $this->_getScope()->getCode() . '/' . $path;
332  }
333 
340  protected function _getConfig($path)
341  {
342  return $this->_scopeConfig->getValue(
343  $path,
344  $this->_scopeType,
345  $this->_getScope()
346  );
347  }
348 
355  public function setRequest(\Magento\Framework\App\RequestInterface $request)
356  {
357  $this->_request = $request;
358  return $this;
359  }
360 
366  protected function _getRequest()
367  {
368  return $this->_request;
369  }
370 
376  protected function _getType()
377  {
378  if (!$this->getRouteParamsResolver()->hasData('type')) {
379  $this->getRouteParamsResolver()->setData('type', self::DEFAULT_URL_TYPE);
380  }
381  return $this->getRouteParamsResolver()->getType();
382  }
383 
389  protected function _isSecure()
390  {
391  if ($this->_request->isSecure()) {
392  if ($this->getRouteParamsResolver()->hasData('secure')) {
393  return (bool) $this->getRouteParamsResolver()->getData('secure');
394  }
395  return true;
396  }
397 
398  if ($this->getRouteParamsResolver()->hasData('secure_is_forced')) {
399  return (bool) $this->getRouteParamsResolver()->getData('secure');
400  }
401 
402  if (!$this->_getScope()->isUrlSecure()) {
403  return false;
404  }
405 
406  if (!$this->getRouteParamsResolver()->hasData('secure')) {
407  if ($this->_getType() == UrlInterface::URL_TYPE_LINK) {
408  $pathSecure = $this->_urlSecurityInfo->isSecure('/' . $this->_getActionPath());
409  $this->getRouteParamsResolver()->setData('secure', $pathSecure);
411  $isRequestSecure = $this->_getRequest()->isSecure();
412  $this->getRouteParamsResolver()->setData('secure', $isRequestSecure);
413  } else {
414  $this->getRouteParamsResolver()->setData('secure', true);
415  }
416  }
417 
418  return $this->getRouteParamsResolver()->getData('secure');
419  }
420 
427  public function setScope($params)
428  {
429  $this->setData('scope', $this->_scopeResolver->getScope($params));
430  $this->getRouteParamsResolver()->setScope($this->_scopeResolver->getScope($params));
431  return $this;
432  }
433 
439  protected function _getScope()
440  {
441  if (!$this->hasData('scope')) {
442  $this->setScope(null);
443  }
444  return $this->_getData('scope');
445  }
446 
453  public function getBaseUrl($params = [])
454  {
458  $origScope = $this->_getScope();
459 
460  if (isset($params['_scope'])) {
461  $this->setScope($params['_scope']);
462  }
463  if (isset($params['_type'])) {
464  $this->getRouteParamsResolver()->setType($params['_type']);
465  }
466 
467  if (isset($params['_secure'])) {
468  $this->getRouteParamsResolver()->setSecure($params['_secure']);
469  }
470 
474  if ($this->_getType() == UrlInterface::URL_TYPE_LINK
475  && $this->_getRequest()->isDirectAccessFrontendName(
476  $this->_getRouteFrontName()
477  )
478  ) {
480  }
481 
482  $result = $this->_getScope()->getBaseUrl($this->_getType(), $this->_isSecure());
483 
484  // setting back the original scope
485  $this->setScope($origScope);
486  $this->getRouteParamsResolver()->setType(self::DEFAULT_URL_TYPE);
487 
488  return $result;
489  }
490 
498  protected function _setRoutePath($data)
499  {
500  if ($this->_getData('route_path') == $data) {
501  return $this;
502  }
503 
504  $this->unsetData('route_path');
505  $routePieces = explode('/', $data);
506 
507  $route = array_shift($routePieces);
508  if ('*' === $route) {
509  $route = $this->_getRequest()->getRouteName();
510  }
511  $this->_setRouteName($route);
512 
513  $controller = '';
514  if (!empty($routePieces)) {
515  $controller = array_shift($routePieces);
516  if ('*' === $controller) {
517  $controller = $this->_getRequest()->getControllerName();
518  }
519  }
521 
522  $action = '';
523  if (!empty($routePieces)) {
524  $action = array_shift($routePieces);
525  if ('*' === $action) {
526  $action = $this->_getRequest()->getActionName();
527  }
528  }
529  $this->_setActionName($action);
530 
531  if (!empty($routePieces)) {
532  while (!empty($routePieces)) {
533  $key = array_shift($routePieces);
534  if (!empty($routePieces)) {
535  $value = array_shift($routePieces);
536  $this->getRouteParamsResolver()->setRouteParam($key, $value);
537  }
538  }
539  }
540 
541  return $this;
542  }
543 
549  protected function _getActionPath()
550  {
551  if (!$this->_getRouteName()) {
552  return '';
553  }
554 
555  $hasParams = (bool) $this->_getRouteParams();
556  $path = $this->_getRouteFrontName() . '/';
557 
558  if ($this->_getControllerName()) {
559  $path .= $this->_getControllerName() . '/';
560  } elseif ($hasParams) {
561  $path .= self::DEFAULT_CONTROLLER_NAME . '/';
562  }
563  if ($this->_getActionName()) {
564  $path .= $this->_getActionName() . '/';
565  } elseif ($hasParams) {
566  $path .= self::DEFAULT_ACTION_NAME . '/';
567  }
568 
569  return $path;
570  }
571 
579  protected function _getRoutePath($routeParams = [])
580  {
581  if (!$this->hasData('route_path')) {
582  $routePath = $this->_getRequest()->getAlias(self::REWRITE_REQUEST_PATH_ALIAS);
583  if (!empty($routeParams['_use_rewrite']) && $routePath !== null) {
584  $this->setData('route_path', $routePath);
585  return $routePath;
586  }
587  $routePath = $this->_getActionPath();
588  if ($this->_getRouteParams()) {
589  foreach ($this->_getRouteParams() as $key => $value) {
590  if ($value === null || false === $value || '' === $value || !is_scalar($value)) {
591  continue;
592  }
593  $routePath .= $key . '/' . $value . '/';
594  }
595  }
596  $this->setData('route_path', $routePath);
597  }
598  return $this->_getData('route_path');
599  }
600 
607  protected function _setRouteName($data)
608  {
609  if ($this->_getData('route_name') == $data) {
610  return $this;
611  }
612  $this->unsetData('route_front_name')
613  ->unsetData('route_path')
614  ->unsetData('controller_name')
615  ->unsetData('action_name');
616  $this->_queryParamsResolver->unsetData('secure');
617  return $this->setData('route_name', $data);
618  }
619 
625  protected function _getRouteFrontName()
626  {
627  if (!$this->hasData('route_front_name')) {
628  $frontName = $this->_routeConfig->getRouteFrontName(
629  $this->_getRouteName(),
630  $this->_scopeResolver->getAreaCode()
631  );
632  $this->setData('route_front_name', $frontName);
633  }
634  return $this->_getData('route_front_name');
635  }
636 
643  protected function _getRouteName($default = null)
644  {
645  return $this->_getData('route_name') ? $this->_getData('route_name') : $default;
646  }
647 
656  protected function _setControllerName($data)
657  {
658  if ($this->_getData('controller_name') == $data) {
659  return $this;
660  }
661  $this->unsetData('route_path')->unsetData('action_name');
662  $this->_queryParamsResolver->unsetData('secure');
663  return $this->setData('controller_name', $data);
664  }
665 
672  protected function _getControllerName($default = null)
673  {
674  return $this->_getData('controller_name') ? $this->_getData('controller_name') : $default;
675  }
676 
684  protected function _setActionName($data)
685  {
686  if ($this->_getData('action_name') == $data) {
687  return $this;
688  }
689  $this->unsetData('route_path');
690  $this->setData('action_name', $data);
691  $this->_queryParamsResolver->unsetData('secure');
692  return $this;
693  }
694 
701  protected function _getActionName($default = null)
702  {
703  return $this->_getData('action_name') ? $this->_getData('action_name') : $default;
704  }
705 
713  protected function _setRouteParams(array $data, $unsetOldParams = true)
714  {
715  $this->getRouteParamsResolver()->setRouteParams($data, $unsetOldParams);
716  return $this;
717  }
718 
724  protected function _getRouteParams()
725  {
726  return $this->getRouteParamsResolver()->getRouteParams();
727  }
728 
736  public function getRouteUrl($routePath = null, $routeParams = null)
737  {
738  if (filter_var($routePath, FILTER_VALIDATE_URL)) {
739  return $routePath;
740  }
741 
742  $this->getRouteParamsResolver()->unsetData('route_params');
743 
744  if (isset($routeParams['_direct'])) {
745  if (is_array($routeParams)) {
746  $this->_setRouteParams($routeParams, false);
747  }
748  return $this->getBaseUrl() . $routeParams['_direct'];
749  }
750 
751  $this->_setRoutePath($routePath);
752  if (is_array($routeParams)) {
753  $this->_setRouteParams($routeParams, false);
754  }
755 
756  return $this->getBaseUrl($routeParams) . $this->_getRoutePath($routeParams);
757  }
758 
764  public function addSessionParam()
765  {
766  $this->setQueryParam(
767  $this->_sidResolver->getSessionIdQueryParam($this->_session),
768  $this->_session->getSessionId()
769  );
770  return $this;
771  }
772 
779  protected function _setQuery($data)
780  {
781  return $this->_queryParamsResolver->setQuery($data);
782  }
783 
790  protected function _getQuery($escape = false)
791  {
792  return $this->_queryParamsResolver->getQuery($escape);
793  }
794 
801  public function addQueryParams(array $data)
802  {
803  $this->_queryParamsResolver->addQueryParams($data);
804  return $this;
805  }
806 
814  public function setQueryParam($key, $data)
815  {
816  $this->_queryParamsResolver->setQueryParam($key, $data);
817  return $this;
818  }
819 
825  protected function _getFragment()
826  {
827  return $this->_getData('fragment');
828  }
829 
839  public function getUrl($routePath = null, $routeParams = null)
840  {
841  if (filter_var($routePath, FILTER_VALIDATE_URL)) {
842  return $routePath;
843  }
844 
845  $routeParams = $this->routeParamsPreprocessor
846  ->execute($this->_scopeResolver->getAreaCode(), $routePath, $routeParams);
847 
848  $isCached = true;
849  $isArray = is_array($routeParams);
850 
851  if ($isArray) {
852  array_walk_recursive(
853  $routeParams,
854  function ($item) use (&$isCached) {
855  if (is_object($item)) {
856  $isCached = false;
857  }
858  }
859  );
860  }
861 
862  if (!$isCached) {
863  return $this->getUrlModifier()->execute(
864  $this->createUrl($routePath, $routeParams)
865  );
866  }
867 
868  $cachedParams = $routeParams;
869  if ($isArray) {
870  ksort($cachedParams);
871  }
872 
873  $cacheKey = sha1($routePath . $this->serializer->serialize($cachedParams));
874  if (!isset($this->cacheUrl[$cacheKey])) {
875  $this->cacheUrl[$cacheKey] = $this->getUrlModifier()->execute(
876  $this->createUrl($routePath, $routeParams)
877  );
878  }
879 
880  return $this->cacheUrl[$cacheKey];
881  }
882 
892  private function createUrl($routePath = null, array $routeParams = null)
893  {
894  $escapeQuery = false;
895  $escapeParams = true;
896 
902  $this->getRouteParamsResolver()->unsetData('secure');
903  $fragment = null;
904  if (isset($routeParams['_fragment'])) {
905  $fragment = $routeParams['_fragment'];
906  unset($routeParams['_fragment']);
907  }
908 
909  if (isset($routeParams['_escape'])) {
910  $escapeQuery = $routeParams['_escape'];
911  unset($routeParams['_escape']);
912  }
913 
914  if (isset($routeParams['_escape_params'])) {
915  $escapeParams = $routeParams['_escape_params'];
916  unset($routeParams['_escape_params']);
917  }
918  $this->getRouteParamsResolver()->setData('escape_params', $escapeParams);
919 
920  $query = null;
921  if (isset($routeParams['_query'])) {
922  $this->_queryParamsResolver->setQueryParams([]);
923  $query = $routeParams['_query'];
924  unset($routeParams['_query']);
925  }
926 
927  $noSid = null;
928  if (isset($routeParams['_nosid'])) {
929  $noSid = (bool)$routeParams['_nosid'];
930  unset($routeParams['_nosid']);
931  }
932  $url = $this->getRouteUrl($routePath, $routeParams);
933 
937  if ($query !== null) {
938  if (is_string($query)) {
939  $this->_setQuery($query);
940  } elseif (is_array($query)) {
941  $this->addQueryParams($query, !empty($routeParams['_current']));
942  }
943  if ($query === false) {
944  $this->addQueryParams([]);
945  }
946  }
947 
948  if ($noSid !== true) {
949  $this->_prepareSessionUrl($url);
950  }
951 
952  $query = $this->_getQuery($escapeQuery);
953  if ($query) {
954  $mark = strpos($url, '?') === false ? '?' : ($escapeQuery ? '&amp;' : '&');
955  $url .= $mark . $query;
956  $this->_queryParamsResolver->unsetData('query');
957  $this->_queryParamsResolver->unsetData('query_params');
958  }
959 
960  if ($fragment !== null) {
961  $url .= '#' . $this->getEscaper()->encodeUrlParam($fragment);
962  }
963  $this->getRouteParamsResolver()->unsetData('secure');
964  $this->getRouteParamsResolver()->unsetData('escape_params');
965 
966  return $url;
967  }
968 
976  protected function _prepareSessionUrl($url)
977  {
978  if (!$this->getUseSession()) {
979  return $this;
980  }
981  $sessionId = $this->_session->getSessionIdForHost($url);
982  if ($this->_sidResolver->getUseSessionVar() && !$sessionId) {
983  $this->setQueryParam('___SID', $this->_isSecure() ? 'S' : 'U');
984  } elseif ($sessionId) {
985  $this->setQueryParam($this->_sidResolver->getSessionIdQueryParam($this->_session), $sessionId);
986  }
987  return $this;
988  }
989 
996  public function getRebuiltUrl($url)
997  {
998  $this->_parseUrl($url);
999  $port = $this->getPort();
1000  if ($port) {
1001  $port = ':' . $port;
1002  } else {
1003  $port = '';
1004  }
1005  $url = $this->getScheme() . '://' . $this->getHost() . $port . $this->getPath();
1006 
1007  $this->_prepareSessionUrl($url);
1008 
1009  $query = $this->_getQuery();
1010  if ($query) {
1011  $url .= '?' . $query;
1012  }
1013 
1014  $fragment = $this->_getFragment();
1015  if ($fragment) {
1016  $url .= '#' . $this->getEscaper()->encodeUrlParam($fragment);
1017  }
1018 
1019  return $url;
1020  }
1021 
1029  public function escape($value)
1030  {
1031  $value = str_replace('"', '%22', $value);
1032  $value = str_replace("'", '%27', $value);
1033  $value = str_replace('>', '%3E', $value);
1034  $value = str_replace('<', '%3C', $value);
1035  return $value;
1036  }
1037 
1045  public function getDirectUrl($url, $params = [])
1046  {
1047  $params['_direct'] = $url;
1048  return $this->getUrl('', $params);
1049  }
1050 
1057  public function sessionUrlVar($html)
1058  {
1059  return preg_replace_callback(
1060  '#(\?|&amp;|&)___SID=([SU])(&amp;|&)?#',
1061  // @codingStandardsIgnoreStart
1068  // @codingStandardsIgnoreEnd
1069  function ($match) {
1070  if ($this->useSessionIdForUrl($match[2] == 'S' ? true : false)) {
1071  return $match[1] . $this->_sidResolver->getSessionIdQueryParam($this->_session) . '='
1072  . $this->_session->getSessionId() . (isset($match[3]) ? $match[3] : '');
1073  } else {
1074  if ($match[1] == '?') {
1075  return isset($match[3]) ? '?' : '';
1076  } elseif ($match[1] == '&amp;' || $match[1] == '&') {
1077  return $match[3] ?? '';
1078  }
1079  }
1080  },
1081  $html
1082  );
1083  }
1084 
1091  public function useSessionIdForUrl($secure = false)
1092  {
1093  $key = 'use_session_id_for_url_' . (int)$secure;
1094  if ($this->getData($key) === null) {
1095  $httpHost = $this->_request->getHttpHost();
1096  $urlHost = parse_url(
1097  $this->_getScope()->getBaseUrl(UrlInterface::URL_TYPE_LINK, $secure),
1098  PHP_URL_HOST
1099  );
1100 
1101  if ($httpHost != $urlHost) {
1102  $this->setData($key, true);
1103  } else {
1104  $this->setData($key, false);
1105  }
1106  }
1107  return $this->getData($key);
1108  }
1109 
1115  public function isOwnOriginUrl()
1116  {
1117  return $this->hostChecker->isOwnOrigin($this->_request->getServer('HTTP_REFERER'));
1118  }
1119 
1127  public function getRedirectUrl($url)
1128  {
1129  $this->_prepareSessionUrl($url);
1130  $query = $this->_getQuery(false);
1131  if ($query) {
1132  $url .= (strpos($url, '?') === false ? '?' : '&') . $query;
1133  }
1134 
1135  return $url;
1136  }
1137 
1143  public function getCurrentUrl()
1144  {
1145  $httpHostWithPort = $this->_request->getHttpHost(false);
1146  $httpHostWithPort = explode(':', $httpHostWithPort);
1147  $httpHost = isset($httpHostWithPort[0]) ? $httpHostWithPort[0] : '';
1148  $port = '';
1149  if (isset($httpHostWithPort[1])) {
1150  $defaultPorts = [
1153  ];
1154  if (!in_array($httpHostWithPort[1], $defaultPorts)) {
1156  $port = ':' . $httpHostWithPort[1];
1157  }
1158  }
1159  return $this->_request->getScheme() . '://' . $httpHost . $port . $this->_request->getRequestUri();
1160  }
1161 
1167  protected function getRouteParamsResolver()
1168  {
1169  if (!$this->_routeParamsResolver) {
1170  $this->_routeParamsResolver = $this->_routeParamsResolverFactory->create();
1171  }
1172  return $this->_routeParamsResolver;
1173  }
1174 
1181  private function getUrlModifier()
1182  {
1183  if ($this->urlModifier === null) {
1184  $this->urlModifier = \Magento\Framework\App\ObjectManager::getInstance()->get(
1185  \Magento\Framework\Url\ModifierInterface::class
1186  );
1187  }
1188 
1189  return $this->urlModifier;
1190  }
1191 
1198  private function getEscaper()
1199  {
1200  if ($this->escaper == null) {
1202  ->get(\Magento\Framework\Escaper::class);
1203  }
1204  return $this->escaper;
1205  }
1206 }
getDirectUrl($url, $params=[])
Definition: Url.php:1045
_getActionName($default=null)
Definition: Url.php:701
getRedirectUrl($url)
Definition: Url.php:1127
setRequest(\Magento\Framework\App\RequestInterface $request)
Definition: Url.php:355
getData($key='', $index=null)
Definition: DataObject.php:119
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
_setRoutePath($data)
Definition: Url.php:498
_prepareSessionUrl($url)
Definition: Url.php:976
setScope($params)
Definition: Url.php:427
useSessionIdForUrl($secure=false)
Definition: Url.php:1091
_getConfigCacheId($path)
Definition: Url.php:329
_getRouteName($default=null)
Definition: Url.php:643
getRebuiltUrl($url)
Definition: Url.php:996
getUrl($routePath=null, $routeParams=null)
Definition: Url.php:839
_getQuery($escape=false)
Definition: Url.php:790
__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)
Definition: Url.php:213
sessionUrlVar($html)
Definition: Url.php:1057
$prefix
Definition: name.phtml:25
setUseSession($useSession)
Definition: Url.php:280
$value
Definition: gender.phtml:16
getConfigData($key, $prefix=null)
Definition: Url.php:307
setQueryParam($key, $data)
Definition: Url.php:814
_setControllerName($data)
Definition: Url.php:656
_setRouteParams(array $data, $unsetOldParams=true)
Definition: Url.php:713
getBaseUrl($params=[])
Definition: Url.php:453
_setRouteName($data)
Definition: Url.php:607
$method
Definition: info.phtml:13
setData($key, $value=null)
Definition: DataObject.php:72
_setActionName($data)
Definition: Url.php:684
_getControllerName($default=null)
Definition: Url.php:672
getRouteUrl($routePath=null, $routeParams=null)
Definition: Url.php:736
addQueryParams(array $data)
Definition: Url.php:801
_getConfig($path)
Definition: Url.php:340
$controller
Definition: info.phtml:14
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18
static $_configDataCache
Definition: Url.php:73
_getRoutePath($routeParams=[])
Definition: Url.php:579
_setQuery($data)
Definition: Url.php:779