Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tsukasa-mixer opened this issue Oct 24, 2018 · 3 comments
Open

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

tsukasa-mixer opened this issue Oct 24, 2018 · 3 comments

Comments

@tsukasa-mixer
Copy link

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

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
Copy link
Contributor

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

@tsukasa-mixer
Copy link
Author

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

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

@AntonOkulov
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants