CodeIgniter Forums

Full Version: How can I add outside code in codeigniter?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone, I have an outside code or script, for example, including functions, classes inside even connecting database. Is there any way to add this code into codeigniter as class libraries or customized codes? Please explain more details if yes. Thanks much
You can include the file inside of the main index.php file like you would any other included file (and you'd treat it like any other included file for instantiation of classes/objects, etc).

Alternatively, you could do a MY_Contoller.php in the core which loads them up via the constructor as a library.