FastRoute
FastRoute copied to clipboard
Fast request router for PHP
Hi! Your library is great. So great in fact that Zend Expressive has an adapter for it. So, thank you very much for this. What I find wrong with it...
Some applications use the router conditionally (say, depending on whether there's cache hit or miss before the router kicks in), and loading functions.php is always loaded which represents a slight...
I got an error when I use cachedDispatcher, I is normal when I use simpleDispatcher The error is: > Fatal error: Call to undefined method Closure::__set_state() in E:\biiblog\src\Bii\route.cache on line...
If routes contain complicated (and inefficient) patterns for parameters the pcre.backtrack_limit or other limits can be reached when checking for matching routes. FastRoute should check if preg_match returned false and...
Regex with no variable: ```php $r->addRoute('GET', '/{user|person}', 'get_user_handler'); ``` Case insensitive flag: ```php $r->addRoute('GET', '/{/user/i}', 'get_user_handler'); ``` I tried both, they did not work. Am I doing it wrong?
Back when I wrote this library, it was intended as a small experiment in efficient routing. I certainly did not expect it to be as widely adopted as it was....
I have a dispatcher like this: ```php \FastRoute\simpleDispatcher(function (\FastRoute\RouteCollector $r): void { $r->addRoute('GET', '/license/{package}', $this->licenseHandler); }); ``` When I visit a URL that looks like this: ``` /license/clue%2Fndjson-react ``` I'd...
Previously, I used `FastRoute\RouteParser\Std::VARIABLE_REGEX` with `preg_replace_callback` in order to make a FastRoute-compatible route URL generator, but in 0.6 (more specifically https://github.com/nikic/FastRoute/commit/31fa86924556b80735f98b294a7ffdfb26789f22) this was changed. Obviously my tests picked it up...
I have Multi language CMS For Front and Admin Page. For English language(defualt without `en`): `example.com/articles/` For France Language(with `fr`): `example.com/fr/articles/` Now, for my url Like This code: ``` $dispatcher...
Looking at the source, I thought the limitation of allowing optional parts only in the end of the route definition was rather arbitrary and made some route definitions much more...