i need to have several function开发者_JAVA百科s in cakephp application (for some regular expression matching).
which is best way to store them, so i can access to them in every controller action?
tnx in adv!
Or, if the actions aren't typical controller actions - you could store them in either a component (available to controllers) then include the component in your AppController.. or you could put the file in the vendors folder and use App::import to load the file into the bootstrap.php
I would recommend you store the functions in the AppController
class. All of your controller classes inherit from this controller.
Also create the app_controller.php
file in the root folder of your application if you have not already.
精彩评论