Welcome Guest, Not a member yet? Register   Sign In
CMS Application structure
#6

[eluser]freshface[/eluser]
What i do for routing is put a loop in routes.php in the config folder.
Like this:

Code:
$handle = opendir(APPPATH.'modules');

if ($handle)
{
    while ( false !== ($module = readdir($handle)) )
    {        
        if (substr($module, 0, 1) != ".")
        {
            if ( file_exists(APPPATH.'modules/'.$module.'/'.$module.'/routes/routes.php') )
            {
                include(APPPATH.'modules/'.$module.'/'.$module.'routes/routes.php');
            }
            
            $route[$module] = $module;
            $route[$module.'/(.*)'] = $module.'/$1';
        }
    }
}


Messages In This Thread
CMS Application structure - by El Forum - 12-16-2008, 01:54 PM
CMS Application structure - by El Forum - 12-17-2008, 06:02 AM
CMS Application structure - by El Forum - 12-17-2008, 06:03 AM
CMS Application structure - by El Forum - 12-17-2008, 06:06 AM
CMS Application structure - by El Forum - 12-17-2008, 09:19 AM
CMS Application structure - by El Forum - 12-17-2008, 09:35 AM
CMS Application structure - by El Forum - 12-17-2008, 09:43 AM
CMS Application structure - by El Forum - 12-17-2008, 09:45 AM
CMS Application structure - by El Forum - 01-02-2009, 10:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB