Reputation: 3267
I am new in cakephp, i want to know how to create a common function.
That means i have some code which will be repeated in multiple controllers at multiple time. So i want to make this codes into a function and us in different controllers.
How can i do this?
Upvotes: 2
Views: 1269
Reputation: 976
Put the function in AppController.php because every controller extends this class. So you can access that function using $this->yourFunction();
Upvotes: 2