Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/book/v1/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Besides the features provided by `mezzio/mezzio-fastroute`, `dot-router` offers
In order to use this feature, first get an instance of the `Dot\Router\RouteCollector` using the below code:

```php
/** @var RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(RouteCollectorInterface::class);
/** @var \Dot\Router\RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(\Dot\Router\RouteCollectorInterface::class);
```

Then rewrite the above routes using the below code:
Expand All @@ -36,10 +36,10 @@ When `dot-router` registers the routes, it will automatically prepend the prefix

### Advantages

- DRY: no need for repeating common route parts
- encapsulation: similar routes are grouped in a single block of code (vs each route a separate statement)
- easy path refactoring: modify all routes at once by changing only the prefix
- easy copying/moving: copying/moving an entire group makes sure that you don't accidentally omit a route
- DRY - no need for repeating common route parts
- encapsulation - similar routes are grouped in a single block of code (vs each route a separate statement)
- easy path refactoring - modify all routes at once by changing only the prefix
- easy copying/moving - copying/moving an entire group makes sure that you don't accidentally omit a route

## Exclude middleware

Expand Down Expand Up @@ -76,5 +76,5 @@ $app->post('/product/create', [CheckOwnerMiddleware::class, CreateProductHandler

### Advantages

- extends the DRY feature of route groups by allowing to specify common middlewares only once per route
- extends the DRYness of route groups by allowing to specify common middlewares only once per route
- shorter and easier-to-read route definitions
4 changes: 0 additions & 4 deletions docs/book/v1/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ Dotkernel component to build complex routes, based on [mezzio/mezzio-fastroute](

> dot-router is a wrapper on top of [mezzio/mezzio-fastroute](https://github.com/mezzio/mezzio-fastroute)

## Documentation

Documentation is available at: https://docs.dotkernel.org/dot-router/.

## Badges

![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-router)
Expand Down
4 changes: 2 additions & 2 deletions docs/book/v1/tutorials/create-route-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Get an instance of the `Dot\Router\RouteCollector` using the below code:

```php
/** @var RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(RouteCollectorInterface::class);
/** @var \Dot\Router\RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(\Dot\Router\RouteCollectorInterface::class);
```

Create a route group, by setting the route group prefix and optionally a(n array of) common middleware(s):
Expand Down
4 changes: 2 additions & 2 deletions docs/book/v1/tutorials/create-single-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Get an instance of the `Dot\Router\RouteCollector` using the below code:

```php
/** @var RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(RouteCollectorInterface::class);
/** @var \Dot\Router\RouteCollectorInterface $routeCollector */
$routeCollector = $container->get(\Dot\Router\RouteCollectorInterface::class);
```

## Create a route that responds to any request method
Expand Down