Welcome Guest, Not a member yet? Register   Sign In
WOrking with custom config files
#11

[eluser]CroNiX[/eluser]
I'd steer clear of extremely common names that CI uses like "config", seeing as how CI uses a lot of things named "config" which is probably why you had a problem. Just like I wouldn't name a controller, "controller". Be creative with your names. 'template_config.php' or something.

Config gets instantiated early on in the bootstrap process, so a lot of CI classes/methods aren't available to it. If you want to see if a directory exists, you just have to use regular php to check it and probably not some CI way.
Code:
if (is_dir('/path/to/your/dir'))
{
  $config['defaultTemplate'] = 'something';
}
else
{
  $config['defaultTemplate'] = 'something_else';
}


Messages In This Thread
WOrking with custom config files - by El Forum - 05-10-2012, 08:44 PM
WOrking with custom config files - by El Forum - 05-10-2012, 09:11 PM
WOrking with custom config files - by El Forum - 05-10-2012, 09:22 PM
WOrking with custom config files - by El Forum - 05-10-2012, 09:31 PM
WOrking with custom config files - by El Forum - 05-10-2012, 11:32 PM
WOrking with custom config files - by El Forum - 05-11-2012, 09:10 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:32 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:34 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:36 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:41 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:46 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:53 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:59 AM
WOrking with custom config files - by El Forum - 05-11-2012, 10:19 AM
WOrking with custom config files - by El Forum - 05-11-2012, 10:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB