Re: Rendering views of another ojbect with AJAX
Hi again [EMAIL PROTECTED], Eventually managed to get back onto this. I am a little lost now as I don't understand why i would need to use: $uses = array(Users, Projects); My biggest problem is the understanding of AJAX and how models work together within AJAX operations! Would the best approach be to have my Projects::Add inside my Users controller like Users::AddProject for example? If i have in Users::Add the following: $this-render('projects/add/', 'ajax'); Cake populates the DIV with an error (and the layout again): You are seeing this error because the view for UsersController::projects/add/() could not be found. So it is always expecting the render path to appended to the current object; not another object! Hmmm; ideally I would like to keep my objects and their methods independent from each other and was hoping they could be used this way with AJAX; but this doesn't seem to be the case. So is it true that I cant render a view from another object inside the view of the active object view? I really wanted to make use of AJAX so that users didn't have to reload entire pages whilst filling in separate forms belonging to different objects/controllers. Has anyone else achieved this? Thanks, Jamieh... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Rendering views of another ojbect with AJAX
On 2/21/07, jamieh [EMAIL PROTECTED] wrote: Hi again [EMAIL PROTECTED], Eventually managed to get back onto this. I am a little lost now as I don't understand why i would need to use: $uses = array(Users, Projects); You would need that if your User and Project are not associated. and you are wanting to do operations on Project from within your UsersController - looks like this is not the case My biggest problem is the understanding of AJAX and how models work together within AJAX operations! The same as normal CakePHP Would the best approach be to have my Projects::Add inside my Users controller like Users::AddProject for example? Yes because you are doing/wanting to do $this-User-Project-save() within the UsersController - the action for whatever you are doing is still in UsersController. But still this is not what you are wanting to do (but doing ;) ) If i have in Users::Add the following: $this-render('projects/add/', 'ajax'); Try using $this-render(null,null,'complete/path/to/project/add.thtml'); Should work, and I presume that the form will submit to ProjectsController::add HTH Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Rendering views of another ojbect with AJAX
Make sure you have var $uses = array(Users, Projects); in your Users controller. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---