Hi Damo, The way to solve it is by using elements. Create viewall.ctp and viewx.ctp in the views folder for your controller. In viewall.ctp, add this <?php echo $this->renderElement('studentsinfo'); ?> Add the same thing to viewx.ctp as well. Finally, create "studentsinfo.ctp" in your views/elements folder with the code for displaying the returned results. This way, viewall and viewx will share the same "view" like you want it to. For more details, try http://manual.cakephp.org/chapter/views Cheers damo wrote: Can't seem to figure this one out. I have two controllers that I would like to use the same view for. Here is how they are:function viewall() { $this->set('students', $this->Student-findAll(array( 'Student.status' => "Active" )));} function viewx() { $this->set('students', $this->Student-findAll(array( 'Student.status' => "Active",'Student.state' != "X"))); } What do I have to add to the 'viewx' to get it to render in the same view as the viewall? Many thanks Damo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~--- |
- single view for multiple controllers damo
- Re: single view for multiple controllers Femi Taiwo
- Re: single view for multiple controllers grigri
- Re: single view for multiple controllers TechSteve
- Re: single view for multiple controllers damo
- Re: single view for multiple controllers Femi Taiwo
- Re: single view for multiple controllers Sourabh Sharma