engine- route 0-9a-z 0-9a-z function args use engine list controller a

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$engine->route('/\/(([0-9a-z]+)?\/?([0-9a-z]+)?)?\/?/i',function ($args) use ($engine){
list(,,$controller,$action)=$args;
//
$controller =class_exists('\controllers\\' . $controller) ? '\controllers\\' . $controller : '\controllers\\' . $engine->get('default.controller');
$CController=new $controller(
$engine
);
//
$action =method_exists($CController,$action) ? $action : 'index';
$CController->$action();
});