Search code examples
cakephpcontrollercakephp-1.2

Have one controller function call a different controller function in CakePHP 1.2


How do I get my Search controller with doSearch() function internally to call getTitles() function in my Titles controller?


Solution

  • The short answer is, you shouldn't do this. You should be moving that to your Title model or maybe put it in a component or helper for reuse.

    If you're sure you want to call the controller directly, Cake does provide a method for this

    http://book.cakephp.org/2.0/en/controllers.html#Controller::requestAction