Include Variable |
[eluser]yoelrodguez[/eluser]
Hi I have a file with variables that I use throughout the system, as I can include it for use in all controllers
[eluser]Tpojka[/eluser]
You need to extend CI_Controller class. Best approach is to make MY_Controller file located in application/core folder that will extends CI_Controller. After that you only need to extend your controllers with MY_Controller NOT WITH CI_Controller. In that file you can store values for approaching later from any file that uses MY_Controller; application/core/MY_Controller.php Code: class MY_Controller extends CI_Controller { application/controllers/blog.php Code: class Blog extends MY_Controller { But also read this page.
[eluser]CroNiX[/eluser]
There is a config system that you can use for this. http://ellislab.com/codeigniter/user-gui...onfig.html Also, if your file is just a bunch of define() statements or something, you can always just include() it in index.php. |
Welcome Guest, Not a member yet? Register Sign In |