Hi All,
Have you ever use controller inside another controller(two controllers) in CakePHP ? If you are looking for the same thing, you are at the right place.
I was working with CakePHP and i need to use a member info method of member controller in order controller(two controller in CakePHP). Instead of writing a code again in order controller, i searched for using controller inside controller. This can be easily done using App::import method of CakePHP.
App::import('Controller', 'Members'); class OrdersController extends AppController { var $Members; function beforeFilter() { $this->Members =& new MembersController; // Loads the class $this->Members->constructClasses(); // Loads the model associations, components, etc. of the Members controller } function index() { $this->Members->memberinfo(); } }---
let me know for Questions by commenting.
best luck.
:D
Nice help Wonder full Post bhavin !
ReplyDeletethis post helped me Many thanks to Blogger 1