Either your controller is doing a model`s job (eg. preprocessing some data prior to insert/update), a component`s job, or what you really need is to redirect the browser to /posts_controller/add/.
try this: look at the code at posts->add, extract the portion that you need to be run in both controllers, and put it in a new method of the Posts (I guess) model, like myAdd, which calls the regular save method. Then you call myAdd directly from the controllers you`re talking about. On Oct 9, 4:06 pm, mscdex <[email protected]> wrote: > On Oct 9, 1:27 pm, Aivaras <[email protected]> wrote: > > > Hey, > > > App::import('Controller', 'PostsController'); > > $this->Posts = new PostsController(); > > $this->Posts->add($this->data); > > > Cheers, > > Aivaras > > I would strongly recommend you re-think how you're going about this. > However, if worst comes to worst and you cannot for some reason re- > structure your application, you could use > requestAction:http://book.cakephp.org/view/434/requestAction --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
