我的目录结构: baby |---apps |---admin |---config |---controller |---modules |---views |---home |---config |---controller |---modules |---views How to create my Router? My code:
$di['router'] = function () {
$router = new Router();
$router->add('/:controller/:action/:params', array(
'module' => 'home',
'controller' => 1,
'action' => 2,
'patams' => 3
));
$router->add('/admin/:controller/:action/:params', array(
'module' => 'admin',
'controller' => 1,
'action' => 2,
'params' => 3
));
return $router;
};
But it is not working, Please help me