Maybe (i don't know if is a valid solution) you can try to do this
thing:

you can import all the controllers, invoke their actions and
then return their computed data , and set those as view variables

something like:

$this->set( 'articles' , $mycontroller->latest_articles() );

so inside your view, you can write:
 $this->element('latest_articles',array($articles) );

but it's quite the same of calling requestAction within the method, ..




On Feb 25, 1:03 pm, Mech7 <[email protected]> wrote:
> No i don't mean a layout... I kinda mean like all controllers are
> accessible through one page controller... and then all actions from
> other controllers articles / banners / etc can be loaded in that page
> as blocks or elements... like a element with latest articles, one with
> 1 article, one with latest comments etc etc.
>
> On Feb 25, 12:12 am, brian <[email protected]> wrote:
>
> > On Tue, Feb 24, 2009 at 11:36 AM, Mech7 <[email protected]> wrote:
>
> > > I am having some problem with trying to accomplish many views on 1
> > > page... I know requestAction works nice and easy but is expensive so i
> > > have been trying to avoid it...
>
> > > Basically what i am trying to do is have one page (or view) and have
> > > all the other views ( or elements ) loaded in there, dynamically like
> > > middle position loads article, right position can load banners or menu
> > > etc..
>
> > This seems more like a layout that your describing.
>
> > > I was thinking instead of using requestAction, I could use App::import
> > > ('Controller', $controllerName);
> > > in a loop to load every actions... and then load all data in a element
> > > which is in the views dir.. which would make the element actually the
> > > same as a view, is it possible to change the location of an element to
> > > view/articles/element_latest.ctp for example?
>
> > > Or does anybody have any good ideas how to do this in other ways... as
> > > it kinda feels weird replacing elements as views.
>
> > I don't think I understand your question but you can do this in your
> > ArticlesController action:
>
> > $this->viewPath = 'elements'.DS.'articles';
> > $this->render('latest');
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to