I just made a mistake. Eventhough it would make sense that way, it is
exactly the opposite. If you look at Cake's object.php you'll see the
following inside requestAction():
if (in_array('return', $extra)) {
$extra['return'] = 0;
$extra['bare'] = 1;
$extra['requested'] = 1;
ob_start();
$out = $dispatcher->dispatch($url, $extra);
$out = ob_get_clean();
return $out;
} else {
$extra['return'] = 1;
$extra['bare'] = 1;
$extra['requested'] = 1;
return $dispatcher->dispatch($url, $extra);
}
Then on Dispatcher::dispatch() you'll find:
if(in_array('return', array_keys($params)) && $params['return'] == 1) {
$controller->autoRender = false;
}
This means that for dispatch() to NOT render the view return has to be set
to 1. And requestAction(), which calls dispatch(), will only set return to 1
when the value 'return' is NOT within extra parameters.
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de jinhr
Enviado el: Martes, 02 de Enero de 2007 02:03 p.m.
Para: Cake PHP
Asunto: Re: render to string
In your controller, you can use:
function myAction()
{
$this->set('result',
$this->requestAction('/otherModel/otherAction', array('return')));
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---