phact-cmf / phact

Content management framework
20 stars 7 forks source link

Предложение: RouteObject #7

Open tsukasa-mixer opened 5 years ago

tsukasa-mixer commented 5 years ago

из роутер возвращать не массив а обьект.

RouteObject -> getHandler() -> getParams() -> getMethod() -> getName() -> invoke()

в итоге выкинуть лишний код из app и сделать компонент более портируемым.

if ($route = $router->match()) 
{
    $this->eventTrigger("application.beforeRunController", [$route], $this);
    $route->invoke();
    $this->eventTrigger("application.afterRunController", [$route], $this);
}
AntonOkulov commented 5 years ago

Редиректы на trailing slash тоже надо выбросить из роутера кмк

tsukasa-mixer commented 5 years ago

Редиректы на trailing slash тоже надо выбросить из роутера кмк

я бы перекинул на мидвару.

AntonOkulov commented 5 years ago

Да, так и надо)