File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,16 @@ use Sunrise\Http\Router\Middleware\JsonPayloadDecodingMiddleware;
480480$router->addMiddleware(new JsonPayloadDecodingMiddleware());
481481```
482482
483+ ### Get a route by name
484+
485+ ``` php
486+ // checks if a route is exists
487+ $router->hasRoute('foo');
488+
489+ // gets a route by name
490+ $router->getRoute('foo');
491+ ```
492+
483493### Get a current route
484494
485495#### Through Router
@@ -642,9 +652,10 @@ $route->getHolder(); // return Reflector (class, method or function)
642652
643653``` php
644654$router = (new RouterBuilder)
645- ->setContainer(null) // null or PSR-11 container instance...
646- ->setCache(null) // null or PSR-16 cache instance... (only for descriptor loader)
647- ->setCacheKey(null) // null or string... (only for descriptor loader)
655+ ->setEventDispatcher(...) // null or use to symfony/event-dispatcher...
656+ ->setContainer(...) // null or PSR-11 container instance...
657+ ->setCache(...) // null or PSR-16 cache instance... (only for descriptor loader)
658+ ->setCacheKey(...) // null or string... (only for descriptor loader)
648659 ->useConfigLoader([]) // array with files or directory with files...
649660 ->useDescriptorLoader([]) // array with classes or directory with classes...
650661 ->setHosts([]) //
You can’t perform that action at this time.
0 commit comments