Routing preview / discussion


(Alexander Makarov) #1

After multiple attempts building a router from ground up I have decided that it could be a waste of time at the moment so it was decided to implement an abstraction and a test adapter based on FastRoute.

Here’s what router looks like: https://github.com/yiisoft/router
And there’s FastRoute adapter: https://github.com/yiisoft/router-fastroute

Later we can get back to implementing our own router.


(mark.ch) #2

It looks like FastRoute came from Nikita Popov who is a bit of a star in the PHP community. He just started working for Jetbrains as well so some good pedigree :slight_smile:


(Alexander Makarov) #3

Yes. He gave a talk last week at PHP Russia I’ve organized. That’s partially why such choice of first adapter to implement was made :slight_smile:


(Alexander Makarov) #4

In its current form the API for defining routes is very minimal. We can extend it with groups, intermediate middleware stacks and more later.


#5

It really looks like huge regression when we compare this with Yii 2 URL Manager. Were there any specific problems with migration of Yii 2 router to Yii 3, or just lack of time?


(Alexander Makarov) #6

Lack of time mainly.


(Tecnologiaterabyte) #7

And it would not be good to ask for help from the Yii community, many of us can help, i could make a to-do list of things that need to be done.


(Alexander Makarov) #8

If you want to help that’s great. You can use issues at https://github.com/yiisoft/router for planning and we can do it together. Contact me at slack / telegram (samdark there).