mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #10286 from freezernick/patch-1
DOCS: address broken code samples
This commit is contained in:
commit
ab0f6228c8
@ -26,6 +26,7 @@ will deliberately return a different response, e.g. an error response or a redir
|
||||
```php
|
||||
use SilverStripe\Control\Middleware\HTTPMiddleware;
|
||||
use SilverStripe\Control\HTTPRequest;
|
||||
use SilverStripe\Control\HTTPResponse;
|
||||
|
||||
class CustomMiddleware implements HTTPMiddleware
|
||||
{
|
||||
@ -75,7 +76,7 @@ SilverStripe\Core\Injector\Injector:
|
||||
SilverStripe\Control\Director:
|
||||
properties:
|
||||
Middlewares:
|
||||
CustomMiddleware: %$CustomMiddleware
|
||||
CustomMiddleware: '%$CustomMiddleware'
|
||||
```
|
||||
|
||||
|
||||
@ -89,7 +90,7 @@ SilverStripe\Core\Injector\Injector:
|
||||
SilverStripe\Control\Director:
|
||||
properties:
|
||||
Middlewares:
|
||||
CustomMiddleware: %$ConfiguredMiddleware
|
||||
CustomMiddleware: '%$ConfiguredMiddleware'
|
||||
ConfiguredMiddleware:
|
||||
class: 'CustomMiddleware'
|
||||
properties:
|
||||
@ -111,14 +112,14 @@ SilverStripe\Core\Injector\Injector:
|
||||
SpecialRouteMiddleware:
|
||||
class: SilverStripe\Control\Middleware\RequestHandlerMiddlewareAdapter
|
||||
properties:
|
||||
RequestHandler: %$MyController
|
||||
RequestHandler: '%$MyController'
|
||||
Middlewares:
|
||||
- %$CustomMiddleware
|
||||
- %$AnotherMiddleware
|
||||
- '%$CustomMiddleware'
|
||||
- '%$AnotherMiddleware'
|
||||
SilverStripe\Control\Director:
|
||||
rules:
|
||||
special\section:
|
||||
Controller: %$SpecialRouteMiddleware
|
||||
special/section:
|
||||
Controller: '%$SpecialRouteMiddleware'
|
||||
```
|
||||
|
||||
## Application middleware
|
||||
|
Loading…
Reference in New Issue
Block a user