Welcome Guest, Not a member yet? Register   Sign In
loading a config file from a different directory
#1

[eluser]Avatar[/eluser]
I'm tryin gto load a config file like this:
Code:
$this->ci->config->load('themes/templates/dark/config/theme.php');
I've also tried this:
Code:
$this->config->load('../views/smarty/templates/dark/config/theme.php');
It echoes the config to my browser and any code after the above line doesn't execute. How would I be able to load a config file from a different directory. Say I want to have each template have a config file. How would I do this?

Actually code after it executes, just the styles don't load for some reason. But it loads the views. Also I've tried without the EXT as above. If I extend the Config libs load function this should fix it. Is there a way to do without extends?
#2

[eluser]Avatar[/eluser]
any help would be greatly appreciated
#3

[eluser]Avatar[/eluser]
I may just have to do i file_get_contents() or file() or something of the sort then.
#4

[eluser]Avatar[/eluser]
has anyone tried to load a config file from a directory other than config?
#5

[eluser]Avatar[/eluser]
ISSUE RESOLVED:

I had to add a second param to $this->load->config() ($this->config->load(),same thing)

like so:
Code:
$this->load->config('../views/'.$this->environ->template.'config/theme',true,true);
print_r($this->config->item('theme'));
give me array of theme configuration options




Theme © iAndrew 2016 - Forum software by © MyBB