Also I would look at Elements. Here is a very good article on the sort of thing you are trying to do http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction
Geoff -- http://lemoncake.wordpress.com On Jul 29, 8:05 am, rtconner <[EMAIL PROTECTED]> wrote: > I think this would be likely best case > > $this->viewPath = 'anothercontrollers_folder'; // not needed if file > is in controllers viewPath already > $this->render('view_file', 'ajax'); // don't use extention ('ajax' is > the layout name) > > Also read up on RequestHandler, it might help you automate this, maybe > overwrite beforeRender in app_controller. > > On Jul 28, 12:16 pm, safl <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I'm struggling with my views. I can't seem to find the proper way to > > reuse view code so what i am doing now is a very nasty: > > > <?php require_once(VIEWS .$this->viewPath.'/set_setting.ctp'); ?> > > > I am guessing that this is not the intended way to do It but i can't > > seem to figure out how i am supposed to resuse my views. > > > The thing is, I got a the controller action -> "user_settings/ > > mySettings'. The view "my_settings.ctp", contains several ajax forms, > > each with different actions ('setSetting', 'changePassword', > > 'setInformation' etc.). > > > These actions need a view to display the form after perform the user > > submission of data and reload the form properly afterwards. > > So If i don't do the above include of my forms i would be forces to > > have the code in both my_settings.ctp and in each individual action > > view. > > > Does anybody have a better solution than the above require/include? > > > regards, > > Simon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---