Well, for some odd reason, that doesnt show much. I have that array above in my config file...it was shortened, I apologize for not closing everything properly.
Basically, I have a function that includes /modules/main/index (or is supposed to) in the event that someone just goes to the root directory and/or someone tries to access a page directly. The user can set the system up so that instead of the default page being in /modules/main/index, it can be /modules/main/about or something similar, and this is all controlled by arrays. Is there an easy way of doing this? I have the following setup:
$config['IndexPage'] = $config['MenuItems']['Main Menu']['Home'], // Default page that user will be directed to.
$config['MenuItems']['Main Menu']['Home'] = array('module' => 'main', 'action' => 'index');
In a totally seperate file, I need to call the variable $config['IndexPage'] as it was just bringing the text straight from the config file, and then stick the last part of the final array on, which would be ['module'] and ['action'] and process it like it was an actual array.
Right now, I have the following code calling the array into the code:
$home = print_r($myst['IndexPage']);
$home = "modules/{$home['module']}/{$home['action']}";
include("{$home}.php");
This, however, returns the following :
Warning: include(/modules//.php) failed to open, no files or directory, etc etc.
Is there an easier way to do this, or what am I missing here? Thanks for any help.