I really hate looking into source code, 'cause I'd rather think that there is everything clean and neat, then look and find out that it is nowhere cleaner then my own (which I kinda dislike a bit :) But anyway...
It turned out that there is "render" function included in the View class, so that resolving the problem like mine is very simple - one can call 'render' function right from the view. Like this: <?php echo $this->render(null, 'ajax', 'test'); ?> null - will be substituted with current action, 'ajax' will ensure that view is not wrapped up in layout, and 'test' is the name of the view file, inside (!) the same action folder! Clean and perfect. P.S. Although I feel a bit uncomfortable now, once I got a glimpse of Cakes internals. On Oct 23, 11:48 am, jayarjo <[email protected]> wrote: > @robustsolution > > But it is said that requestAction adds unnecessary load on the > backend, making another http request, isn't that true? If yes, then > why should anyone need something like that when it's just a matter of > simple include? It can be though, that I miss some point in what > you've suggested - I do not feel like being on ground yet when using > Cake. > > @jacmoe, @Lance Willett > > Not a bad solution, although pieces still get separated, despite of > the fact that they are actually one View. I guess that's what I'll > have to stick to though. Thanks guys. > > On Oct 23, 6:44 am, Lance Willett <[email protected]> wrote: > > > As jacmoe said, the best practice is to put elements specific to one > > view into a subfolder named the same as the view. That way you aren't > > cluttering the elements directory with lots of files, and the element > > files specific to that view will be easy to find and call. > > > Example: if the element belong to /views/users, put it in /views/ > > elements/users/. > > > On Oct 22, 4:13 am, jayarjo <[email protected]> wrote: > > > > I'm getting a huge View and I'm thinking now of splitting it into > > > separate pieces and include them into the main View, as I will need > > > them. I know I can create Elements and include them, but the problem > > > is that those smaller Views that I'd like to create are specific to > > > this main View only. So that I'd rather store them inside that folder > > > named after the Controller of the main View rather then clutter > > > Elements folder with unnecessary files. Is there any widespread > > > solution to this? There should be some. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
