![]() |
WOrking with custom config files - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: WOrking with custom config files (/showthread.php?tid=51616) Pages:
1
2
|
WOrking with custom config files - El Forum - 05-11-2012 [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')) WOrking with custom config files - El Forum - 05-11-2012 [eluser]xtremer360[/eluser] Here's the only problem I can forsee with the suggested code from CroNix which is nice by the way is that I also use the modular system by wiredesignz and have a application/views/peach or any other template folders AND application/modules/views/peach or any other template folders WOrking with custom config files - El Forum - 05-11-2012 [eluser]CroNiX[/eluser] so check Code: APPPATH . 'views/peach'; Code: APPPATH . 'modules/views/peach'; Not sure why that would be a problem? WOrking with custom config files - El Forum - 05-11-2012 [eluser]weboap[/eluser] then it will be always useful to have a default template set. to fall back to if your 'peach' (or whatever the user choose in the config file...)template doesn't exist . that way your site doesn't.... WOrking with custom config files - El Forum - 05-11-2012 [eluser]xtremer360[/eluser] right as that was my intention. Thanks to ChroNiX for the code suggestion. |