Reputation: 1443
I have to call a controller method from another controller and I am using requestAction() for this purpose. I have realized that requestAction is taking a lot of time. Can anybody suggest another function, other than requestAction() to achieve this. Thanks
Upvotes: 2
Views: 642
Reputation: 7585
I would say if you are needing to do this, it is the overall design of your application that needs rethinking.
You can also make your models fatter and then using loadModel() to call the code in the model.
Upvotes: 3
Reputation: 522135
Logic that is shared among more than one controller should be put into the AppController, a component or a model, depending on where it fits best. Cross-requesting is expensive however you slice it, if you need to instantiate the other controller.
Upvotes: 2