Hi Sebastian,
I think that requestAction is often considered/used when a method that
should be in a model is located in a controller - if you are only
retreiving data from a model, possibly after manipulating it a bit,
consider moving the logic that is in your controller to the model and
then simply call the model(s) as required. That is, if you can´t get
all the data you want via intelligent use of bind, unbind and
recursive.
Also if you are using requestAction just because you don´t want to
duplicate your view code (a good thing) consider using elements for
your relavent object views.
I always use the same examples, but e.g.:
/app/views/comments/view.thtml
<?
echo $this->renderElement ("comment",Array("data"=>$data));
?>
/app/views/blogs/view.thtml
<?
echo $this->renderElement ("blog",Array("data"=>$data));
?>
/app/views/elements/blog.thtml
<?
.... blog stuff ....
foreach ($data['Comment'] as $comment) {
echo $this->renderElement ("comment",Array("data"=>$comment)); //
probably need to rearrange the comment array a bit, writing from
memory.
}
HTH,
AD7six
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---