[1676] and [1677]

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1678 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-12-29 05:07:12 +00:00
parent 1b5f14494c
commit 6009ff5b7b
4 changed files with 19 additions and 13 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.4.1652_beta
0.10.4.1678_beta

View file

@ -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;

View file

@ -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;
}
}
?>

View file

@ -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;