web.com/art/artname
$class = $request->$controller.'.controller';
$obj = new $class;
$act = $obj->showArticle($request->action);
web.com/auth/login
automatically called by auth.controller but then the problem because in the auth.no showArticle controller method, and it is hard-coded in the router.web.com/art/show/artname
web.com/art/edit/artname
web.com/auth/enter/login
$class = $request->$controller.'.controller';
$obj = new $class;
$act = $obj->$request->action($request->data);
web.com/artedit/artname
$class = $request->$controller.'.controller';
$obj = new $class;
$act = $obj->main($request->action);
if($controller == 'art'){
$act = $obj->showArticle($request->action);
}
elseif($controller == 'artedit') {
$act = $obj->edit($request->action);
}
Find more questions by tags PHP