Skip to content
Merged
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
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,24 @@ Add to `config/config.php`:
Webware\Navigation\ConfigProvider::class,
```

The middleware is self-registering via `ConfigProvider`. No manual pipeline edit
is required beyond the entry in `config/config.php`.
That registers the middleware factory and the `navigation` view helper. The
middleware itself is **not** piped for you: add it to `config/pipeline.php`
after `RouteMiddleware` and before `DispatchMiddleware`, so that `RouteResult`
is on the request by the time it runs:

```php
$app->pipe(RouteMiddleware::class);
// ...
$app->pipe(UrlHelperMiddleware::class);
$app->pipe(NavigationMiddleware::class);
$app->pipe(DispatchMiddleware::class);
```

The package deliberately does not self-register through Mezzio's
`middleware_pipeline` config. That mechanism orders middleware by an integer
priority, and this middleware's correctness depends on running after
`RouteMiddleware` and before `DispatchMiddleware`, an ordering such a priority
cannot express safely. See [Architecture](docs/architecture.md), Decision 7.

## Namespace

Expand Down
Loading