Step1:- Put this script in your routes.php in config folder
// admin and modules
$handle = opendir(APPPATH.'modules');
if ($handle)
{
while ( false !== ($module = readdir($handle)) )
{
// make sure we don't map silly dirs like .svn, or . or ..

if (substr($module, 0, 1) != ".")
{
if ( file_exists(APPPATH.'modules/'.$module.'/'.$module.'_routes.php') )
{
include(APPPATH.'modules/'.$module.'/'.$module.'_routes.php');
}

if ( file_exists(APPPATH.'modules/'.$module.'/controllers/admin.php') )
{
$route['admin/'.$module] = $module.'/admin';
$route['admin/'.$module.'/(.*)'] = $module.'/admin/$1';
}

if ( file_exists(APPPATH.'modules/'.$module.'/controllers/'.$module.'.php') )
{
$route[$module] = $module;
$route[$module.'/(.*)'] = $module.'/$1';
}
}
}
}

 Step2 : -make modulename_routes.php in your module folder

good its done

Advertisements