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
-~----------~----~----~----~------~----~------~--~---