mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merging:
[1676] and [1677] git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1678 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1b5f14494c
commit
6009ff5b7b
4 changed files with 19 additions and 13 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
0.10.4.1652_beta
|
||||
0.10.4.1678_beta
|
|
@ -108,11 +108,6 @@ class Dispatcher extends Object
|
|||
|
||||
$this->base = $this->baseUrl();
|
||||
|
||||
if(!in_array('render', array_keys($params)))
|
||||
{
|
||||
$params['render'] = 0;
|
||||
}
|
||||
|
||||
if (empty($params['controller']))
|
||||
{
|
||||
$missingController = true;
|
||||
|
@ -176,6 +171,19 @@ class Dispatcher extends Object
|
|||
$missingAction = true;
|
||||
}
|
||||
|
||||
if(!in_array('return', array_keys($params)) && $controller->autoRender == true)
|
||||
{
|
||||
$params['render'] = 1;
|
||||
}
|
||||
elseif(in_array('return', array_keys($params)) && $params['return'] == 1)
|
||||
{
|
||||
$params['render'] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$params['render'] = 0;
|
||||
}
|
||||
|
||||
$controller->base = $this->base;
|
||||
$controller->here = $this->base.'/'.$url;
|
||||
$controller->webroot = $this->webroot;
|
||||
|
|
|
@ -71,7 +71,6 @@ class PagesController extends AppController{
|
|||
$this->set('subpage', empty($path[1])? null: $path[1]);
|
||||
$this->set('title', ucfirst($path[count($path)-1]));
|
||||
$this->render(join('/', $path));
|
||||
$this->autoRender = false;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -97,19 +97,18 @@ class Object
|
|||
function requestAction ($url, $extra = array())
|
||||
{
|
||||
$dispatcher =& new Dispatcher();
|
||||
|
||||
if(in_array('render', $extra))
|
||||
if(in_array('return', $extra))
|
||||
{
|
||||
$extra['render'] = 0;
|
||||
$extra['bare'] = 1;
|
||||
ob_start();
|
||||
$extra['return'] = 0;
|
||||
$extra['bare'] = 1;
|
||||
ob_start();
|
||||
$out = $dispatcher->dispatch($url, $extra);
|
||||
$out = ob_get_clean();
|
||||
return $out;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extra['render'] = 1;
|
||||
$extra['return'] = 1;
|
||||
$extra['bare'] = 1;
|
||||
$out = $dispatcher->dispatch($url, $extra);
|
||||
return $out;
|
||||
|
|
Loading…
Reference in a new issue