How to create global variables in CakePHP?
In this blog we are going to discuss about how to create global varaibles in CakePHP. We have explained all method step by step. You can easily understand how to work on this. If you have any query related to PHP programming and you can ask at php developer forum and get answers instantly from the highly experienced community members. The majority of the developers, develop skepticism in which, what's the correct place/Page in which they should declare the constant variable in cakephp. Previous going to variable declaration, we must consider that any of us will work over a MVC platform and also we should not break the rules of MVC.
There are many place in which we are able to establish the particular constant variables in cakephp, these include practices
METHOD-1
Get a file referred to as core.php inside app/config/ folder involving cakephp setup listing. Presently there you will need to open the particular core.php. app/config/core.php For you to declare a constant global variable in cakephp, core.php only create following syntax. 1 Configure:: write('variableName', 'value'); In order to constant global variable your Controller/Model/View, that is declared in core.php. Only create..... Read Full Blogs : How to create global variables in CakePHP?