Class Mage_Core_Controller_Varien_Action

Description

Custom Zend_Controller_Action class (formally)

Allows dispatching before and after events for each controller action

Located in /Core/Controller/Varien/Action.php (line 37)


	
			
Direct descendents
Class Description
Mage_Adminhtml_Controller_Action Base adminhtml controller
Mage_Core_Controller_Front_Action Base front controller
Mage_Install_Controller_Action Magento
Class Constant Summary
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_ERROR_URL = 'error_url'
PARAM_NAME_REFERER_URL = 'referer_url'
PARAM_NAME_SUCCESS_URL = 'success_url'
PROFILER_KEY = 'mage::dispatch::controller::action'
Variable Summary
string $_currentArea
array $_flags
Zend_Controller_Request_Abstract $_request
Zend_Controller_Response_Abstract $_response
array $_titles
Method Summary
Mage_Core_Controller_Varien_Action __construct ( $request,  $response, [ $invokeArgs = array()])
void dispatch ( $action)
void getActionMethodName ( $action)
bool getFlag (string $action, [string $flag = ''])
string getFullActionName ([string $delimiter = '_'])
void hasAction ( $action)
Mage_Core_Controller_Varien_Action initLayoutMessages (string|array $messagesStorage)
Mage_Core_Controller_Varien_Action loadLayout ([string $handles = null], [boolean $generateBlocks = true], [ $generateXml = true], string $cacheId)
void noCookiesAction ()
void norouteAction ([ $coreRoute = null])
void postDispatch ()
void preDispatch ()
Mage_Core_Controller_Varien_Action setFlag (string $action, string $flag, string $value)
void _construct ()
array _filterDates (array $array, array $dateFields)
array _filterDateTime (array $array, array $dateFields)
void _forward (string $action, [string|null $controller = null], [string|null $module = null], [ $params = null])
string _getRealModuleName ()
string _getRefererUrl ()
Mage_Core_Controller_Varien_Action _initLayoutMessages (string|array $messagesStorage)
bool _isUrlInternal (string $url)
Mage_Core_Controller_Varien_Action _prepareDownloadResponse (string $fileName, string|array $content, [string $contentType = 'application/octet-stream'], [int $contentLength = null])
void _redirect (string $path, [array $arguments = array()])
void _redirectError (string $defaultUrl)
Mage_Core_Controller_Varien_Action _redirectReferer ([string $defaultUrl = null])
void _redirectSuccess (string $defaultUrl)
void _renderTitles ()
boolean _rewrite ()
Mage_Core_Controller_Varien_Action _title ([string|false|-1|null $text = null], [ $resetIfExists = true])
Variables
array $_cookieCheckActions = array() (line 90)

Action list where need check enabled cookie

  • access: protected

Redefined in descendants as:
string $_currentArea (line 97)

Currently used area

  • access: protected

Redefined in descendants as:
array $_flags = array() (line 83)

Action flags

for example used to disable rendering default layout

  • access: protected
bool $_isLayoutLoaded = false (line 113)

Whether layout is loaded

  • see: self::loadLayout()
  • access: protected
string $_realModuleName (line 74)

Real module name (like 'Mage_Module')

  • access: protected
bool $_removeDefaultTitle = false (line 129)

Whether the default title should be removed

  • see: self::_title()
  • access: protected
Zend_Controller_Request_Abstract $_request (line 60)

Request object

  • access: protected
Zend_Controller_Response_Abstract $_response (line 67)

Response object

  • access: protected
string $_sessionNamespace (line 105)

Namespace for session.

Should be defined for proper working session.

  • access: protected

Redefined in descendants as:
array $_titles = array() (line 121)

Title parts to be rendered in the page head title

  • see: self::_title()
  • access: protected
Methods
Constructor __construct (line 138)

Constructor

  • access: public
Mage_Core_Controller_Varien_Action __construct ( $request,  $response, [ $invokeArgs = array()])
  • Zend_Controller_Request_Abstract $request
  • Zend_Controller_Response_Abstract $response
  • array $invokeArgs
addActionLayoutHandles (line 276)
  • access: public
void addActionLayoutHandles ()
dispatch (line 397)
  • access: public
void dispatch ( $action)
  • $action
generateLayoutBlocks (line 330)
  • access: public
void generateLayoutBlocks ()
generateLayoutXml (line 311)
  • access: public
void generateLayoutXml ()
getActionMethodName (line 453)
  • access: public
void getActionMethodName ( $action)
  • $action
getFlag (line 185)

Retrieve flag value

  • access: public
bool getFlag (string $action, [string $flag = ''])
  • string $action
  • string $flag
getFullActionName (line 225)

Retrieve full bane of current action current controller and current module

  • access: public
string getFullActionName ([string $delimiter = '_'])
  • string $delimiter
getLayout (line 237)

Retrieve current layout object

  • access: public
Mage_Core_Model_Layout getLayout ()
getRequest (line 163)

Retrieve request object

  • access: public
getResponse (line 173)

Retrieve response object

  • access: public
hasAction (line 153)
  • access: public
void hasAction ( $action)
  • $action
initLayoutMessages (line 643)

Inits layout messages by message storage(s), loading and adding messages to layout messages block

  • access: public
Mage_Core_Controller_Varien_Action initLayoutMessages (string|array $messagesStorage)
  • string|array $messagesStorage
loadLayout (line 250)

Load layout by handles(s)

  • access: public
Mage_Core_Controller_Varien_Action loadLayout ([string $handles = null], [boolean $generateBlocks = true], [ $generateXml = true], string $cacheId)
  • string $handles
  • string $cacheId
  • boolean $generateBlocks
  • $generateXml

Redefined in descendants as:
loadLayoutUpdates (line 293)
  • access: public
void loadLayoutUpdates ()
noCookiesAction (line 557)
  • access: public
void noCookiesAction ()

Redefined in descendants as:
norouteAction (line 534)
  • access: public
void norouteAction ([ $coreRoute = null])
  • $coreRoute

Redefined in descendants as:
postDispatch (line 517)

Dispatches event after action

  • access: public
void postDispatch ()

Redefined in descendants as:
preDispatch (line 462)

Dispatches event before action

  • access: public
void preDispatch ()

Redefined in descendants as:
renderLayout (line 362)

Rendering layout

  • access: public
Mage_Core_Controller_Varien_Action renderLayout ([string $output = ''])
  • string $output
setFlag (line 209)

Setting flag value

  • access: public
Mage_Core_Controller_Varien_Action setFlag (string $action, string $flag, string $value)
  • string $action
  • string $flag
  • string $value
_filterDates (line 931)

Convert dates in array from localized to internal format

  • access: protected
array _filterDates (array $array, array $dateFields)
  • array $array
  • array $dateFields
_filterDateTime (line 959)

Convert dates with time in array from localized to internal format

  • access: protected
array _filterDateTime (array $array, array $dateFields)
  • array $array
  • array $dateFields
_forward (line 587)

Throw control to different action (control and module if was specified).

  • access: protected
void _forward (string $action, [string|null $controller = null], [string|null $module = null], [ $params = null])
  • string $action
  • string|null $controller
  • string|null $module
  • string|null $params

Redefined in descendants as:
_getRealModuleName (line 775)

Get real module name (like 'Mage_Module')

  • access: protected
string _getRealModuleName ()
_getRefererUrl (line 731)

Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param)

  • access: protected
string _getRefererUrl ()
_initLayoutMessages (line 616)

Inits layout messages by message storage(s), loading and adding messages to layout messages block

  • access: protected
Mage_Core_Controller_Varien_Action _initLayoutMessages (string|array $messagesStorage)
  • string|array $messagesStorage
_isUrlInternal (line 756)

Check url to be used as internal

  • access: protected
bool _isUrlInternal (string $url)
  • string $url
_prepareDownloadResponse (line 990)

Declare headers and content file in responce for file download

  • access: protected
Mage_Core_Controller_Varien_Action _prepareDownloadResponse (string $fileName, string|array $content, [string $contentType = 'application/octet-stream'], [int $contentLength = null])
  • string $fileName
  • string|array $content: set to null to avoid starting output, $contentLength should be set explicitly in that case
  • string $contentType
  • int $contentLength: explicit content length, if strlen($content) isn't applicable
_redirect (line 666)

Set redirect into response

  • access: protected
void _redirect (string $path, [array $arguments = array()])
  • string $path
  • array $arguments

Redefined in descendants as:
_redirectError (line 695)

Redirect to error page

  • access: protected
void _redirectError (string $defaultUrl)
  • string $defaultUrl
_redirectReferer (line 714)

Set referer url for redirect in responce

  • access: protected
Mage_Core_Controller_Varien_Action _redirectReferer ([string $defaultUrl = null])
  • string $defaultUrl

Redefined in descendants as:
_redirectSuccess (line 677)

Redirect to success page

  • access: protected
void _redirectSuccess (string $defaultUrl)
  • string $defaultUrl
_redirectUrl (line 654)

Set redirect url into response

  • access: protected
Mage_Core_Controller_Varien_Action _redirectUrl (string $url)
  • string $url
_renderTitles (line 908)

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

  • see: self::loadLayout()
  • see: self::renderLayout()
  • access: protected
void _renderTitles ()
_rewrite (line 814)

Support for controllers rewrites

Example of configuration: <global> <routers> <core_module> <rewrite> <core_controller> <to>new_route/new_controller</to> <override_actions>true</override_actions> <actions> <core_action><to>new_module/new_controller/new_action</core_action> </actions> <core_controller> </rewrite> </core_module> </routers> </global>

This will override:

  1. core_module/core_controller/core_action to new_module/new_controller/new_action
  2. all other actions of core_module/core_controller to new_module/new_controller

  • return: true if rewrite happened
  • access: protected
boolean _rewrite ()
_title (line 878)

Add an extra title to the end or one from the end, or remove all

Usage examples: $this->_title('foo')->_title('bar'); => bar / foo / <default title>

$this->_title()->_title('foo')->_title('bar'); => bar / foo

$this->_title('foo')->_title(false)->_title('bar'); bar / <default title>

  • see: self::_renderTitles()
  • access: protected
Mage_Core_Controller_Varien_Action _title ([string|false|-1|null $text = null], [ $resetIfExists = true])
  • string|false|-1|null $text
  • $resetIfExists
_validateFormKey (line 852)

Validate Form Key

  • access: protected
bool _validateFormKey ()
Class Constants
FLAG_NO_CHECK_INSTALLATION = 'no-install-check' (line 39)
FLAG_NO_COOKIES_REDIRECT = 'no-cookies-redirect' (line 45)
FLAG_NO_DISPATCH = 'no-dispatch' (line 40)
FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch' (line 44)
FLAG_NO_POST_DISPATCH = 'no-postDispatch' (line 42)
FLAG_NO_PRE_DISPATCH = 'no-preDispatch' (line 41)
FLAG_NO_START_SESSION = 'no-startSession' (line 43)
PARAM_NAME_BASE64_URL = 'r64' (line 50)
PARAM_NAME_ERROR_URL = 'error_url' (line 48)
PARAM_NAME_REFERER_URL = 'referer_url' (line 49)
PARAM_NAME_SUCCESS_URL = 'success_url' (line 47)
PARAM_NAME_URL_ENCODED = 'uenc' (line 51)
PROFILER_KEY = 'mage::dispatch::controller::action' (line 53)

Documentation generated on Fri, 11 Feb 2011 16:55:55 +0200 by phpDocumentor 1.4.3