Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 777
cdub Avatar asked Dec 10 '25 09:12

cdub


1 Answers

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

like image 117
JohnP Avatar answered Dec 14 '25 11:12

JohnP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!