Welcome Guest, Not a member yet? Register   Sign In
Where is the best place to include inc file??
#3

[eluser]PhilTem[/eluser]
You may include it in any file you want, but you must be sure to not include it within any class or any class' method.

I'd suggest you create a MY_Controller in ./application/core/ and put the 'include' line before you start the description of your MY_Controller class:

Code:
<?php
include('options.inc.php');

class MY_Controller extends CI_Controller {

}

/* File location: ./application/core/MY_Controller.php /*

However, it is much more MVC-/CI-style to create a config file of your configs, put it into ./application/config/your_config.php and have the config file being autoloaded within ./application/config/autoload.php in $autoload['config']. That way it will also be global put you do it in a better way.
You can then access your config-items with

Code:
config_item('status_read');


Messages In This Thread
Where is the best place to include inc file?? - by El Forum - 06-22-2012, 03:22 PM
Where is the best place to include inc file?? - by El Forum - 06-22-2012, 03:46 PM
Where is the best place to include inc file?? - by El Forum - 06-22-2012, 10:14 PM
Where is the best place to include inc file?? - by El Forum - 06-23-2012, 03:46 AM
Where is the best place to include inc file?? - by El Forum - 06-23-2012, 09:35 AM
Where is the best place to include inc file?? - by El Forum - 06-23-2012, 11:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB