Mage_Cms_PageController
extends Mage_Core_Controller_Front_Action
in package
Maho
Tags
Table of Contents
Constants
- FLAG_NO_CHECK_INSTALLATION = 'no-install-check'
- FLAG_NO_COOKIES_REDIRECT = 'no-cookies-redirect'
- FLAG_NO_DISPATCH = 'no-dispatch'
- FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch'
- FLAG_NO_POST_DISPATCH = 'no-postDispatch'
- FLAG_NO_PRE_DISPATCH = 'no-preDispatch'
- FLAG_NO_START_SESSION = 'no-startSession'
- PARAM_NAME_BASE64_URL = 'r64'
- PARAM_NAME_ERROR_URL = 'error_url'
- PARAM_NAME_REFERER_URL = 'referer_url'
- PARAM_NAME_SUCCESS_URL = 'success_url'
- PARAM_NAME_URL_ENCODED = 'uenc'
- PROFILER_KEY = 'mage::dispatch::controller::action'
- SESSION_LEGACY_NAMESPACES = ['om_frontend', 'frontend']
- SESSION_MAX_LIFETIME = 60 * 60 * 24 * 400
- SESSION_MIN_LIFETIME = 60 * 60
- SESSION_NAMESPACE = 'maho_session'
- Session constants to refer in other places
Properties
- $_cookieCheckActions : array<string|int, mixed>
- Action list where need check enabled cookie
- $_currentArea : string
- Currently used area
- $_flags : array<string|int, mixed>
- Action flags
- $_isLayoutLoaded : bool
- Whether layout is loaded
- $_realModuleName : string
- Real module name (like 'Mage_Module')
- $_removeDefaultTitle : bool
- Whether the default title should be removed
- $_request : Mage_Core_Controller_Request_Http
- Request object
- $_response : Mage_Core_Controller_Response_Http
- Response object
- $_sessionNamespace : string
- Namespace for session.
- $_titles : array<string|int, mixed>
- Title parts to be rendered in the page head title
Methods
- __() : string
- Translate a phrase
- __construct() : mixed
- addActionLayoutHandles() : $this
- dispatch() : mixed
- generateLayoutBlocks() : $this
- generateLayoutXml() : $this
- getActionMethodName() : string
- Retrieve action method name
- getFlag() : array<string|int, mixed>|bool
- Retrieve flag value
- getFullActionName() : string
- Retrieve full bane of current action current controller and current module
- getLayout() : Mage_Core_Model_Layout
- Retrieve current layout object
- getRequest() : Mage_Core_Controller_Request_Http
- Retrieve request object
- getResponse() : Mage_Core_Controller_Response_Http
- Retrieve response object
- hasAction() : bool
- initLayoutMessages() : $this
- Initializing layout messages by message storage(s), loading and adding messages to layout messages block
- loadLayout() : $this
- Load layout by handles(s)
- loadLayoutUpdates() : $this
- noCookiesAction() : mixed
- norouteAction() : mixed
- postDispatch() : $this
- Postdispatch: should set last visited url
- preDispatch() : $this
- Predispatch: should set layout area
- renderLayout() : $this|void
- Rendering layout
- setFlag() : $this
- Setting flag value
- setRedirectWithCookieCheck() : $this
- Set redirect into response with session id in URL if it is enabled.
- viewAction() : mixed
- _construct() : void
- _filterDates() : array<string|int, mixed>
- Convert dates in array from localized to internal format
- _filterDateTime() : array<string|int, mixed>
- Convert dates with time in array from localized to internal format
- _forward() : mixed
- Throw control to different action (control and module if was specified).
- _getRealModuleName() : string
- Get real module name (like 'Mage_Module')
- _getRefererUrl() : string
- Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param)
- _initLayoutMessages() : $this
- Initializing layout messages by message storage(s), loading and adding messages to layout messages block
- _isFormKeyEnabled() : bool
- Check if form key validation is enabled.
- _isUrlInternal() : bool
- Check url to be used as internal
- _prepareDownloadResponse() : $this
- Declare headers and content file in response for file download
- _redirect() : $this
- Set redirect into response
- _redirectError() : $this
- Redirect to error page
- _redirectReferer() : $this
- Set referer url for redirect in response
- _redirectSuccess() : $this
- Redirect to success page
- _redirectUrl() : $this
- Set redirect url into response
- _renderTitles() : mixed
- Prepare titles in the 'head' layout block Supposed to work only in actions where layout is rendered Falls back to the default logic if there are no titles eventually
- _rewrite() : bool
- Support for controllers rewrites
- _title() : $this
- Add an extra title to the end or one from the end, or remove all
- _validateFormKey() : bool
- Validate Form Key
- isFormkeyValidationOnCheckoutEnabled() : bool
- Check if form_key validation enabled on checkout process
Constants
FLAG_NO_CHECK_INSTALLATION
public
mixed
FLAG_NO_CHECK_INSTALLATION
= 'no-install-check'
FLAG_NO_COOKIES_REDIRECT
public
mixed
FLAG_NO_COOKIES_REDIRECT
= 'no-cookies-redirect'
FLAG_NO_DISPATCH
public
mixed
FLAG_NO_DISPATCH
= 'no-dispatch'
FLAG_NO_DISPATCH_BLOCK_EVENT
public
mixed
FLAG_NO_DISPATCH_BLOCK_EVENT
= 'no-beforeGenerateLayoutBlocksDispatch'
FLAG_NO_POST_DISPATCH
public
mixed
FLAG_NO_POST_DISPATCH
= 'no-postDispatch'
FLAG_NO_PRE_DISPATCH
public
mixed
FLAG_NO_PRE_DISPATCH
= 'no-preDispatch'
FLAG_NO_START_SESSION
public
mixed
FLAG_NO_START_SESSION
= 'no-startSession'
PARAM_NAME_BASE64_URL
public
mixed
PARAM_NAME_BASE64_URL
= 'r64'
PARAM_NAME_ERROR_URL
public
mixed
PARAM_NAME_ERROR_URL
= 'error_url'
PARAM_NAME_REFERER_URL
public
mixed
PARAM_NAME_REFERER_URL
= 'referer_url'
PARAM_NAME_SUCCESS_URL
public
mixed
PARAM_NAME_SUCCESS_URL
= 'success_url'
PARAM_NAME_URL_ENCODED
public
mixed
PARAM_NAME_URL_ENCODED
= 'uenc'
PROFILER_KEY
public
mixed
PROFILER_KEY
= 'mage::dispatch::controller::action'
SESSION_LEGACY_NAMESPACES
public
mixed
SESSION_LEGACY_NAMESPACES
= ['om_frontend', 'frontend']
SESSION_MAX_LIFETIME
public
mixed
SESSION_MAX_LIFETIME
= 60 * 60 * 24 * 400
SESSION_MIN_LIFETIME
public
mixed
SESSION_MIN_LIFETIME
= 60 * 60
SESSION_NAMESPACE
Session constants to refer in other places
public
mixed
SESSION_NAMESPACE
= 'maho_session'
Max lifetime is set to 400 days, as chromium based browsers will not allow anything higher https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-cookie-lifetime-limits
Properties
$_cookieCheckActions
Action list where need check enabled cookie
protected
array<string|int, mixed>
$_cookieCheckActions
= []
$_currentArea
Currently used area
protected
string
$_currentArea
= \Mage_Core_Model_App_Area::AREA_FRONTEND
$_flags
Action flags
protected
array<string|int, mixed>
$_flags
= []
for example used to disable rendering default layout
$_isLayoutLoaded
Whether layout is loaded
protected
bool
$_isLayoutLoaded
= \false
Tags
$_realModuleName
Real module name (like 'Mage_Module')
protected
string
$_realModuleName
$_removeDefaultTitle
Whether the default title should be removed
protected
bool
$_removeDefaultTitle
= \false
Tags
$_request
Request object
protected
Mage_Core_Controller_Request_Http
$_request
$_response
Response object
protected
Mage_Core_Controller_Response_Http
$_response
$_sessionNamespace
Namespace for session.
protected
string
$_sessionNamespace
= self::SESSION_NAMESPACE
$_titles
Title parts to be rendered in the page head title
protected
array<string|int, mixed>
$_titles
= []
Tags
Methods
__()
Translate a phrase
public
__() : string
Return values
string__construct()
public
__construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response[, array<string|int, mixed> $invokeArgs = [] ]) : mixed
Parameters
- $request : Zend_Controller_Request_Abstract
- $response : Zend_Controller_Response_Abstract
- $invokeArgs : array<string|int, mixed> = []
addActionLayoutHandles()
public
addActionLayoutHandles() : $this
Tags
Return values
$thisdispatch()
public
dispatch(string $action) : mixed
Parameters
- $action : string
generateLayoutBlocks()
public
generateLayoutBlocks() : $this
Return values
$thisgenerateLayoutXml()
public
generateLayoutXml() : $this
Return values
$thisgetActionMethodName()
Retrieve action method name
public
getActionMethodName(string $action) : string
Parameters
- $action : string
Return values
stringgetFlag()
Retrieve flag value
public
getFlag(string $action[, string $flag = '' ]) : array<string|int, mixed>|bool
Parameters
- $action : string
- $flag : string = ''
Return values
array<string|int, mixed>|boolgetFullActionName()
Retrieve full bane of current action current controller and current module
public
getFullActionName([string $delimiter = '_' ]) : string
Parameters
- $delimiter : string = '_'
Return values
stringgetLayout()
Retrieve current layout object
public
getLayout() : Mage_Core_Model_Layout
Return values
Mage_Core_Model_LayoutgetRequest()
Retrieve request object
public
getRequest() : Mage_Core_Controller_Request_Http
Return values
Mage_Core_Controller_Request_HttpgetResponse()
Retrieve response object
public
getResponse() : Mage_Core_Controller_Response_Http
Return values
Mage_Core_Controller_Response_HttphasAction()
public
hasAction(string $action) : bool
Parameters
- $action : string
Return values
boolinitLayoutMessages()
Initializing layout messages by message storage(s), loading and adding messages to layout messages block
public
initLayoutMessages(string|array<string|int, mixed> $messagesStorage) : $this
Parameters
- $messagesStorage : string|array<string|int, mixed>
Return values
$thisloadLayout()
Load layout by handles(s)
public
loadLayout([array<string|int, mixed>|string|null|bool $handles = null ][, bool $generateBlocks = true ][, bool $generateXml = true ]) : $this
Parameters
- $handles : array<string|int, mixed>|string|null|bool = null
- $generateBlocks : bool = true
- $generateXml : bool = true
Return values
$thisloadLayoutUpdates()
public
loadLayoutUpdates() : $this
Tags
Return values
$thisnoCookiesAction()
public
noCookiesAction() : mixed
norouteAction()
public
norouteAction([mixed|null $coreRoute = null ]) : mixed
Parameters
- $coreRoute : mixed|null = null
postDispatch()
Postdispatch: should set last visited url
public
postDispatch() : $this
Attributes
- #[Override]
Return values
$thispreDispatch()
Predispatch: should set layout area
public
preDispatch() : $this
Attributes
- #[Override]
Return values
$thisrenderLayout()
Rendering layout
public
renderLayout([string $output = '' ]) : $this|void
Parameters
- $output : string = ''
Return values
$this|voidsetFlag()
Setting flag value
public
setFlag(string $action, string $flag, string|int|bool $value) : $this
Parameters
- $action : string
- $flag : string
- $value : string|int|bool
Return values
$thissetRedirectWithCookieCheck()
Set redirect into response with session id in URL if it is enabled.
public
setRedirectWithCookieCheck(string $path[, array<string|int, mixed> $arguments = [] ]) : $this
It allows to distinguish primordial request from browser with cookies disabled.
Parameters
- $path : string
- $arguments : array<string|int, mixed> = []
Return values
$thisviewAction()
public
viewAction() : mixed
_construct()
protected
_construct() : void
_filterDates()
Convert dates in array from localized to internal format
protected
_filterDates(array<string|int, mixed> $array, array<string|int, mixed> $dateFields) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
- $dateFields : array<string|int, mixed>
Return values
array<string|int, mixed>_filterDateTime()
Convert dates with time in array from localized to internal format
protected
_filterDateTime(array<string|int, mixed> $array, array<string|int, mixed> $dateFields) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
- $dateFields : array<string|int, mixed>
Return values
array<string|int, mixed>_forward()
Throw control to different action (control and module if was specified).
protected
_forward(string $action[, string|null $controller = null ][, string|null $module = null ][, array<string|int, mixed>|null $params = null ]) : mixed
Parameters
- $action : string
- $controller : string|null = null
- $module : string|null = null
- $params : array<string|int, mixed>|null = null
_getRealModuleName()
Get real module name (like 'Mage_Module')
protected
_getRealModuleName() : string
Return values
string_getRefererUrl()
Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param)
protected
_getRefererUrl() : string
Return values
string_initLayoutMessages()
Initializing layout messages by message storage(s), loading and adding messages to layout messages block
protected
_initLayoutMessages(string|array<string|int, mixed> $messagesStorage) : $this
Parameters
- $messagesStorage : string|array<string|int, mixed>
Return values
$this_isFormKeyEnabled()
Check if form key validation is enabled.
protected
_isFormKeyEnabled() : bool
since 25.5.0
Return values
bool_isUrlInternal()
Check url to be used as internal
protected
_isUrlInternal(string $url) : bool
Parameters
- $url : string
Return values
bool_prepareDownloadResponse()
Declare headers and content file in response for file download
protected
_prepareDownloadResponse(string $fileName, string|array<string|int, mixed> $content[, string $contentType = 'application/octet-stream' ][, int $contentLength = null ]) : $this
Parameters
- $fileName : string
- $content : string|array<string|int, mixed>
-
set to null to avoid starting output, $contentLength should be set explicitly in that case
- $contentType : string = 'application/octet-stream'
- $contentLength : int = null
-
explicit content length, if strlen($content) isn't applicable
Attributes
- #[Override]
Return values
$this_redirect()
Set redirect into response
protected
_redirect(string $path[, array<string|int, mixed> $arguments = [] ]) : $this
Parameters
- $path : string
- $arguments : array<string|int, mixed> = []
Return values
$this_redirectError()
Redirect to error page
protected
_redirectError(string $defaultUrl) : $this
Parameters
- $defaultUrl : string
Return values
$this_redirectReferer()
Set referer url for redirect in response
protected
_redirectReferer([string $defaultUrl = null ]) : $this
Parameters
- $defaultUrl : string = null
Return values
$this_redirectSuccess()
Redirect to success page
protected
_redirectSuccess(string $defaultUrl) : $this
Parameters
- $defaultUrl : string
Return values
$this_redirectUrl()
Set redirect url into response
protected
_redirectUrl(string $url) : $this
Parameters
- $url : string
Return values
$this_renderTitles()
Prepare titles in the 'head' layout block Supposed to work only in actions where layout is rendered Falls back to the default logic if there are no titles eventually
protected
_renderTitles() : mixed
Tags
_rewrite()
Support for controllers rewrites
protected
_rewrite() : bool
Example of configuration:
This will override:
- core_module/core_controller/core_action to new_module/new_controller/new_action
- all other actions of core_module/core_controller to new_module/new_controller
Return values
bool —true if rewrite happened
_title()
Add an extra title to the end or one from the end, or remove all
protected
_title([string|false|int|null $text = null ][, bool $resetIfExists = true ]) : $this
Usage examples:
$this->_title('foo')->_title('bar');
=> bar / foo /
$this->_title()->_title('foo')->_title('bar'); => bar / foo
$this->_title('foo')->_title(false)->_title('bar');
bar /
Parameters
- $text : string|false|int|null = null
- $resetIfExists : bool = true
Tags
Return values
$this_validateFormKey()
Validate Form Key
protected
_validateFormKey() : bool
Return values
boolisFormkeyValidationOnCheckoutEnabled()
Check if form_key validation enabled on checkout process
protected
isFormkeyValidationOnCheckoutEnabled() : bool