Subversion Repositories PHPX

Compare Revisions

Last modification

Ignore whitespace Rev 30 → Rev 29

/trunk/Controller.php
34,17 → 34,8
protected $_defaultAction = 'index';
/**
* If an array, maps an action name to an action method of the controller.
* The {@link View} used by this controller
*
* Fallback for IE 7 where the content of a <code>button</code> element
* is submitted as value.
*
* @var array
*/
protected $_actionMap = null;
/**
* The {@link View} used by this controller
* @var View
*/
protected $_view = null;
59,7 → 50,8
* Resource path of the template for the view. The default
* is the empty string.
*/
protected function __construct($viewClass = 'View', $template = null)
protected function __construct($viewClass = 'View',
$template = null)
{
$this->_view = new $viewClass($template);
 
73,18 → 65,7
$action = $this->_defaultAction;
}
 
$actionMethod = lcfirst($action) . 'Action';
/* Fallback for IE 7 where the content of a `button' element is submitted as value */
if (!method_exists($this, $actionMethod))
{
if (is_array($this->_actionMap) && array_key_exists($action, $this->_actionMap))
{
$actionMethod = $this->_actionMap[$action];
}
}
$this->$actionMethod();
$this->{lcfirst($action) . 'Action'}();
}
/**