![]() |
how to load config file in library - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: how to load config file in library (/showthread.php?tid=43397) |
how to load config file in library - El Forum - 07-09-2011 [eluser]runrun[/eluser] I got a config file asset.php My config file is like so Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I want to load it in a library called Asset My library code is like so Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); You can see I'm attempting to load the config file. Problem is it doesn't work, it's showing me a blank webpage when I run this library. how to load config file in library - El Forum - 07-10-2011 [eluser]Vheissu[/eluser] The issue is that you're trying to store a copy of the CI super object as a class variable which will not work. You need to store it inside of a class constructor. See below for code that will work ![]() Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |