requestAction is almost a new pass through the whole pipeline.
http://www.cakecollab.org/lifecycle.png
In this diagram, a requestAction starts at about "Dispatch
$_GET['url']"
> * can it maintain variables set elsewhere in the class (like in the
> method which called the requestAction() method)?
No. To pass variables through to the new request, either put them in
the requestAction call ie:
$your_data = $this->requestAction('/controller/action',
array('somedata'=>'whatever'));
would come through as $this->params['somedata'] in the new action. Of
course the session persists too, and I expect $_GLOBAL would too - but
I wouldn't recommend this.
> * is there a more optimal way to render an action on the same
> controller into a variable?
Yes, you can start output buffering, manually call render(), catch the
output in the buffer, and use that.
> * are there any techniques to optimize this function?
Only not to use it. Put common functionality into a model, component,
or app_controller, so you don't need to query another controller. Try
to use some caching mechanism to store any rendered data you may need
again. Access the View directly to render parts if possible (although
this should probably be wrapped in a component).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---