• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routing problem

#1
[eluser]hostingx[/eluser]
Hello people!

I'm working with the codeigniter custom version of Elliot Haughin, with the module system in it..

but i have a problem i cant solve!

I want to make several modules,

e.g: news, invoice, member etc..

all these modules need to have an admin, so i also made a module admin,

the module reads the menu's from the several modules.. but here is when i got stuck!

I want to use more then one controller in each module, 1 controller for the module: lets say news, and one for the admin panel for the module, lets say news_admin

But i can only call one controller, that should have the same name as the module, how can i change this?

here is my router file:

Code:
$exclude =     array(
                    '.',
                    '..',
                    'index.html',
                    'pages.php'
                );

    $handle = opendir(APPPATH.'modules/');
    
    while ( false !== ($file = readdir($handle)))
    {
        if ( !in_array($file, $exclude) )
        {
            if ( !is_dir(APPPATH.'modules/'.$file) )
            {
                $file = substr($file, 0, strlen($file) - 4);
            }
            
            $installed_modules[] = $file;
        }
    }
    
    //die(print_r($installed_modules));
    
    closedir($handle);
    
                        
foreach ($installed_modules as $module)
{
    // e.g. index.php/news
    
    $route[$module] = $module;
    
    // e.g. index.php/news/view/hello-me/
    
    $route[$module."/(.*)"] = $module."/$1";
    
}

hope you guys can help me out here!

#2
[eluser]hostingx[/eluser]
Noone?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.