Skip to content

Commit 88e7969

Browse files
author
Анатолий Нехай
committed
update README.md
1 parent c7eddc8 commit 88e7969

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff 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([]) //

0 commit comments

Comments
 (0)