mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 21:12:41 +00:00
Merging fixes and enhancements into trunk.
Revision: [2193] Adding fix for Ticket #471 Revision: [2192] Adding fix from Ticket #464. Revision: [2191] Adding fix for Ticket #461 Revision: [2190] Adding fix for array_merge_recursive() error when unbindModelis used Revision: [2189] merging changes made in model_php5.php Revision: [2188] Fixing controller so $viewPath can be set as a var Revision: [2186] Adding Security component Revision: [2185] Adding additional RequestHandler detection, form security authentication, and automagic view variable $data Revision: [2183] Fixing Ticket #473 Revision: [2182] Adding fix for Ticket #261 Revision: [2181] Changing MySQL column defs from 12 hour times to 24 (#465) Revision: [2180] Fixing Tickets #463 and #462, and an error in Controller::setAction() Revision: [2179] Fixing a bug I found in AjaxHelper::link(), and changing the stopwatch time to 4 decimals Revision: [2177] Added patch from Ticket #459 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2195 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f6cf220c40
commit
03ba042f41
15 changed files with 163 additions and 39 deletions
|
@ -102,6 +102,36 @@ class RequestHandlerComponent extends Object
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current call a POST request
|
||||
*
|
||||
* @return bool True if call is a POST
|
||||
*/
|
||||
function isPost()
|
||||
{
|
||||
return (low(env('REQUEST_METHOD')) == 'post');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current call a PUT request
|
||||
*
|
||||
* @return bool True if call is a PUT
|
||||
*/
|
||||
function isPut()
|
||||
{
|
||||
return (low(env('REQUEST_METHOD')) == 'put');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current call a GET request
|
||||
*
|
||||
* @return bool True if call is a GET
|
||||
*/
|
||||
function isGet()
|
||||
{
|
||||
return (low(env('REQUEST_METHOD')) == 'get');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets Prototype version if call is Ajax, otherwise empty string.
|
||||
|
|
|
@ -90,7 +90,7 @@ class Controller extends Object
|
|||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
var $viewPath;
|
||||
var $viewPath = null;
|
||||
|
||||
/**
|
||||
* Variables for the view
|
||||
|
@ -208,7 +208,12 @@ class Controller extends Object
|
|||
}
|
||||
$this->name = $r[1];
|
||||
}
|
||||
$this->viewPath = Inflector::underscore($this->name);
|
||||
|
||||
if ($this->viewPath == null)
|
||||
{
|
||||
$this->viewPath = Inflector::underscore($this->name);
|
||||
}
|
||||
|
||||
$this->modelClass = Inflector::singularize($this->name);
|
||||
$this->modelKey = Inflector::underscore($this->modelClass);
|
||||
|
||||
|
@ -395,6 +400,8 @@ class Controller extends Object
|
|||
$this->action = $action;
|
||||
|
||||
$args = func_get_args();
|
||||
unset($args[0]);
|
||||
|
||||
call_user_func_array(array(&$this, $action), $args);
|
||||
}
|
||||
|
||||
|
@ -461,6 +468,18 @@ class Controller extends Object
|
|||
|
||||
$this->beforeRender();
|
||||
|
||||
if (!isset($this->_viewVars['data']))
|
||||
{
|
||||
if (isset($this->params['data']))
|
||||
{
|
||||
$this->set('data', $this->params['data']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->set('data', array());
|
||||
}
|
||||
}
|
||||
|
||||
$this->_viewClass =& new $viewClass($this);
|
||||
if(!empty($this->modelNames))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue