How does Fastroute?

Good night!
Tell me how the library works nikic/FastRoute.
Downloaded this library and can not on this basis to develop a simple routing.
for example: clicking on the link site.com/ - otkryvaetsya template in the root folder /templates/theme1/index.tpl by clicking on the link site.com/admin - open the administration panel by clicking on the link site.com/articles/1/ -- opening page of the article first page etc.
But most of what you need to learn and understand what is written in this library.
Please help. If something is not clear, please do not judge strictly, as I'm a beginner developer.
March 23rd 20 at 18:57
2 answers
March 23rd 20 at 18:59
Well, working is quite simple: assemble all rules in a single regular season. The example in Doc is very good.
March 23rd 20 at 19:01
How you will study the inside, even if just to use as can't read/understand?

How does Fastroute?

for regexps, like all routers. In this case, it was the first router that used the "lifehack" of combining all the regexps into one than he could accelerate at times compared to other routers at that time.
And it was originally just a router-an example of the use of this technique by the author.
The author himself nikic began to drink a lot of features of php which were added over the last year.
for regexps, like all routers.


Um... Actually, it's not all ranting and working. Most, but not all. - nathanael_Rohan96 commented on March 23rd 20 at 19:04

Find more questions by tags PHP