Class Mage_Core_Model_Url

Description

URL

Properties:

  • request
  • relative_url: true, false
  • type: 'link', 'skin', 'js', 'media'
  • store: instanceof Mage_Core_Model_Store
  • secure: true, false
  • scheme: 'http', 'https'
  • user: 'user'
  • password: 'password'
  • host: 'localhost'
  • port: 80, 443
  • base_path: '/dev/magento/'
  • base_script: 'index.php'
  • storeview_path: 'storeview/'
  • route_path: 'module/controller/action/param1/value1/param2/value2'
  • route_name: 'module'
  • controller_name: 'controller'
  • action_name: 'action'
  • route_params: array('param1'=>'value1', 'param2'=>'value2')
  • query: (?)'param1=value1&param2=value2'
  • query_array: array('param1'=>'value1', 'param2'=>'value2')
  • fragment: (#)'fragment-anchor'
URL structure:

https://user:password@host:443/base_path/[base_script][storeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment \__________A___________/\____________________________________B_____________________________________/ \__________________C___________________/ \__________________D_________________/ \_____E_____/ \_____________F______________/ \___________________________G______________________/ \___________________________________________________H____________________________________________________/

  • A: authority
  • B: path
  • C: absolute_base_url
  • D: action_path
  • E: route_params
  • F: host_url
  • G: route_path
  • H: route_url

Located in /Core/Model/Url.php (line 79)

Varien_Object
   |
   --Mage_Core_Model_Url
Direct descendents
Class Description
Mage_Adminhtml_Model_Url Magento
Class Constant Summary
XML_PATH_SECURE_IN_ADMIN = 'web/secure/use_in_adminhtml'
XML_PATH_SECURE_IN_FRONT = 'web/secure/use_in_frontend'
XML_PATH_SECURE_URL = 'web/secure/base_url'
XML_PATH_UNSECURE_URL = 'web/unsecure/base_url'
Variable Summary
static mixed $_configDataCache
static mixed $_encryptedSessionId
Zend_Controller_Request_Http $_request
Method Summary
void addSessionParam ()
unknown checkCookieDomains ()
string escape (string $value)
void getActionName ()
void getActionPath ()
string getBaseUrl ([array $params = array()])
void getConfigData ( $key, [ $prefix = null])
string getDirectUrl (string $url, [array $params = array()])
void getFragment ()
string getQuery ([bool $escape = false])
void getQueryParam ( $key)
array getQueryParams ()
Zend_Controller_Request_Http getRequest ()
void getRouteName ()
void getRouteParam ( $key)
void getRouteParams ()
void getRoutePath ([ $routeParams = array()])
void getRouteUrl ([ $routePath = null], [ $routeParams = null])
bool getSecure ()
void getType ()
string getUrl ([string $routePath = null], [array $routeParams = null])
bool getUseSession ()
boolean isOwnOriginUrl ()
Mage_Core_Model_Url parseUrl (string $url)
string sessionUrlVar (string $html)
string sessionVarCallback (array $match)
Mage_Core_Model_Url setQuery (mixed $data)
void setQueryParam ( $key,  $data)
void setRequest ( $request)
void setRouteFrontName ( $name)
void setRouteName ( $data)
void setRouteParam ( $key,  $data)
void setRouteParams ( $data, [ $unsetOldParams = true])
void setStore ( $data)
Mage_Core_Model_Url setUseSession (bool $useSession)
void setUseUrlCache ( $flag)
bool useSessionIdForUrl ([bool $secure = false])
void _construct ()
Variables
static mixed $_configDataCache (line 90)
  • access: protected
static mixed $_encryptedSessionId (line 91)
  • access: protected
Zend_Controller_Request_Http $_request (line 109)

Controller request object

  • access: protected
array $_reservedRouteParams = array(
'_store', '_type', '_secure', '_forced_secure', '_use_rewrite', '_nosid',
'_absolute', '_current', '_direct', '_fragment', '_escape', '_query',
'_store_to_url'
)
(line 98)

Reserved Route parametr keys

  • access: protected
bool $_useSession (line 116)

Use Session ID for generate URL

  • access: protected
Methods
addSessionParam (line 653)
  • access: public
void addSessionParam ()
checkCookieDomains (line 631)

If the host was switched but session cookie won't recognize it - add session id to query

  • access: public
unknown checkCookieDomains ()
escape (line 902)

Escape (enclosure) URL string

  • access: public
string escape (string $value)
  • string $value
getActionName (line 503)
  • access: public
void getActionName ()
getActionPath (line 386)
  • access: public
void getActionPath ()
getBaseUrl (line 306)

Retrieve Base URL

  • access: public
string getBaseUrl ([array $params = array()])
  • array $params
getConfigData (line 207)
  • access: public
void getConfigData ( $key, [ $prefix = null])
  • $key
  • $prefix
getControllerName (line 482)
  • access: public
void getControllerName ()
getDefaultActionName (line 202)

Retrieve default action name

  • access: public
string getDefaultActionName ()
getDefaultControllerName (line 155)

Retrieve default controller name

  • access: public
string getDefaultControllerName ()
getDirectUrl (line 918)

Build url by direct url and parameters

  • access: public
string getDirectUrl (string $url, [array $params = array()])
  • string $url
  • array $params
getFragment (line 793)
  • access: public
void getFragment ()
getQuery (line 692)

Get query params part of url

  • access: public
string getQuery ([bool $escape = false])
  • bool $escape: "&" escape flag
getQueryParam (line 774)
  • access: public
void getQueryParam ( $key)
  • $key
getQueryParams (line 748)

Retrurn Query Params

  • access: public
array getQueryParams ()
getRequest (line 234)

Zend request object

  • access: public
Zend_Controller_Request_Http getRequest ()
getRouteFrontName (line 448)
  • access: public
void getRouteFrontName ()
getRouteName (line 461)
  • access: public
void getRouteName ()
getRouteParam (line 599)
  • access: public
void getRouteParam ( $key)
  • $key
getRouteParams (line 583)
  • access: public
void getRouteParams ()
getRoutePath (line 409)
  • access: public
void getRoutePath ([ $routeParams = array()])
  • $routeParams
getRouteUrl (line 604)
  • access: public
void getRouteUrl ([ $routePath = null], [ $routeParams = null])
  • $routePath
  • $routeParams
getSecure (line 255)

Retrieve is secure mode URL

  • access: public
bool getSecure ()

Redefined in descendants as:
getStore (line 292)

Get current store for the url instance

  • access: public
Mage_Core_Model_Store getStore ()
getType (line 242)
  • access: public
void getType ()
getUrl (line 805)

Build url by requested path and parameters

  • access: public
string getUrl ([string $routePath = null], [array $routeParams = null])
  • string $routePath
  • array $routeParams

Redefined in descendants as:
getUseSession (line 189)

Retrieve use session rule

  • access: public
bool getUseSession ()
isOwnOriginUrl (line 995)

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

  • access: public
boolean isOwnOriginUrl ()
parseUrl (line 129)

Initialize object data from retrieved url

  • access: public
Mage_Core_Model_Url parseUrl (string $url)
  • string $url
purgeQueryParams (line 737)

Purge Query params array

  • access: public
Mage_Core_Model_Url purgeQueryParams ()
sessionUrlVar (line 929)

Replace Session ID value in URL

  • access: public
string sessionUrlVar (string $html)
  • string $html
sessionVarCallback (line 963)

Callback function for session replace

  • access: public
string sessionVarCallback (array $match)
  • array $match
setActionName (line 494)

Set Action name Reseted route path if action name has change

  • access: public
Mage_Core_Model_Url setActionName (string $data)
  • string $data
setControllerName (line 473)

Set Controller Name Reset action name and route path if has change

  • access: public
Mage_Core_Model_Url setControllerName (string $data)
  • string $data
setFragment (line 788)

Set fragment to URL

  • access: public
Mage_Core_Model_Url setFragment (string $data)
  • string $data
setQuery (line 677)

Set URL query param(s)

  • access: public
Mage_Core_Model_Url setQuery (mixed $data)
  • mixed $data
setQueryParam (line 763)
  • access: public
void setQueryParam ( $key,  $data)
  • $key
  • $data
setQueryParams (line 712)

Set query Params as array

  • access: public
Mage_Core_Model_Url setQueryParams ( $data)
  • array $data
setRequest (line 223)
  • access: public
void setRequest ( $request)
  • Zend_Controller_Request_Http $request
setRouteFrontName (line 178)
  • access: public
void setRouteFrontName ( $name)
  • $name
setRouteName (line 435)
  • access: public
void setRouteName ( $data)
  • $data
setRouteParam (line 588)
  • access: public
void setRouteParam ( $key,  $data)
  • $key
  • $data
setRouteParams (line 508)
  • access: public
void setRouteParams ( $data, [ $unsetOldParams = true])
  • array $data
  • $unsetOldParams

Redefined in descendants as:
setRoutePath (line 335)

Set Route Parameters

  • access: public
Mage_Core_Model_Url setRoutePath (array $data)
  • array $data
setStore (line 281)
  • access: public
void setStore ( $data)
  • $data
setUseSession (line 172)

Set use session rule

  • access: public
Mage_Core_Model_Url setUseSession (bool $useSession)
  • bool $useSession
setUseUrlCache (line 160)
  • access: public
void setUseUrlCache ( $flag)
  • $flag
useSessionIdForUrl (line 940)

Check and return use SID for URL

  • access: public
bool useSessionIdForUrl ([bool $secure = false])
  • bool $secure
_construct (line 118)
  • access: protected
void _construct ()
_prepareSessionUrl (line 872)

Check and add session id to URL

  • access: protected
Mage_Core_Model_Url _prepareSessionUrl (string $url)
  • string $url
Class Constants
DEFAULT_ACTION_NAME = 'index' (line 82)
DEFAULT_CONTROLLER_NAME = 'index' (line 81)
XML_PATH_SECURE_IN_ADMIN = 'web/secure/use_in_adminhtml' (line 87)
XML_PATH_SECURE_IN_FRONT = 'web/secure/use_in_frontend' (line 88)
XML_PATH_SECURE_URL = 'web/secure/base_url' (line 85)
XML_PATH_UNSECURE_URL = 'web/unsecure/base_url' (line 84)

Documentation generated on Fri, 11 Feb 2011 17:15:31 +0200 by phpDocumentor 1.4.3