I build four modules: Admin Home User Home ,and an Addons Then I create four router:
$router->add("/index/:controller/:action/:params", array(
'module' => 'index',
'controller' => 1,
'action' => 2,
'params' => 3,
));
$router->add("/admin/:controller/:action/:params", array(
'module' => 'admin',
'controller' => 1,
'action' => 2,
'params' => 3,
));
$router->add("/home/:controller/:action/:params", array(
'module' => 'home',
'controller' => 1,
'action' => 2,
'params' => 3,
));
$router->add("/user/:controller/:action/:params", array(
'module' => 'user',
'controller' => 1,
'action' => 2,
'params' => 3,
));
if users input: Home/...or User/... or Index/... or Admin/... ,it will redirect to their modules,But users input anywords which is not in 'home,admin,user,index',it will redirect allows:
$router->add("**....**/:params.", array(
'module' => 'user',
'controller' => 'addons',
'action' =>'excut',
'addons' =>'',(this is the head word)
'params' => 1,
));
How to write the last router-string???Please help me