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

Improve router #353

Open
7 tasks
johanjanssens opened this issue May 23, 2020 · 1 comment
Open
7 tasks

Improve router #353

johanjanssens opened this issue May 23, 2020 · 1 comment
Assignees
Labels

Comments

@johanjanssens
Copy link
Member

johanjanssens commented May 23, 2020

At the moment page, redirect and file routing works independently through different event subscribers. Refactor the implementation to route through the http dispatcher.

  • Allow to attach different routers (similar to attaching resolvers)
  • If no specific route passed iterate through each router to resolve the request
  • Add a file controller and implement a download action to handle file downloads
  • Allow setting different cache settings per router (page, file, redirect)
  • Make qualify() method signature match generate() and resolve()
  • Add magic getter and get() method to route object
  • Filter the url query variables using the url filter before injecting them into the route (security)

Notes:

  • Refactor ComPagesDispatcherRouterAbstract::getRoute() to createRoute() and make getRoute() return the last generated route for the specific router.

  • Allow for getRoute('site') and getRoute('page') to get a route from a specific router.

  • Set a default router fallback in ComPagesDispatcherRouter in case a specific router is not specified.

  • Implement router routing in ComPagesDispatcherRouter in a similar way to resolver router, using a double linked list.

  • Allow to return route query variables through magic getter and provide a get() method. => Remove support for magic 'path' and 'query' from the route. See: Add route constraint for language codes #391

Related:

@johanjanssens
Copy link
Member Author

Thoughts; refactor singleton router to a router factory, dispatcher router would use the factory to create the correct router, which means it no longer needs to be a singleton.

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

No branches or pull requests

1 participant