mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Compare commits
2 Commits
1261926911
...
ab0f6228c8
Author | SHA1 | Date | |
---|---|---|---|
|
ab0f6228c8 | ||
|
107c7196ac |
@ -26,6 +26,7 @@ will deliberately return a different response, e.g. an error response or a redir
|
|||||||
```php
|
```php
|
||||||
use SilverStripe\Control\Middleware\HTTPMiddleware;
|
use SilverStripe\Control\Middleware\HTTPMiddleware;
|
||||||
use SilverStripe\Control\HTTPRequest;
|
use SilverStripe\Control\HTTPRequest;
|
||||||
|
use SilverStripe\Control\HTTPResponse;
|
||||||
|
|
||||||
class CustomMiddleware implements HTTPMiddleware
|
class CustomMiddleware implements HTTPMiddleware
|
||||||
{
|
{
|
||||||
@ -75,7 +76,7 @@ SilverStripe\Core\Injector\Injector:
|
|||||||
SilverStripe\Control\Director:
|
SilverStripe\Control\Director:
|
||||||
properties:
|
properties:
|
||||||
Middlewares:
|
Middlewares:
|
||||||
CustomMiddleware: %$CustomMiddleware
|
CustomMiddleware: '%$CustomMiddleware'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ SilverStripe\Core\Injector\Injector:
|
|||||||
SilverStripe\Control\Director:
|
SilverStripe\Control\Director:
|
||||||
properties:
|
properties:
|
||||||
Middlewares:
|
Middlewares:
|
||||||
CustomMiddleware: %$ConfiguredMiddleware
|
CustomMiddleware: '%$ConfiguredMiddleware'
|
||||||
ConfiguredMiddleware:
|
ConfiguredMiddleware:
|
||||||
class: 'CustomMiddleware'
|
class: 'CustomMiddleware'
|
||||||
properties:
|
properties:
|
||||||
@ -111,14 +112,14 @@ SilverStripe\Core\Injector\Injector:
|
|||||||
SpecialRouteMiddleware:
|
SpecialRouteMiddleware:
|
||||||
class: SilverStripe\Control\Middleware\RequestHandlerMiddlewareAdapter
|
class: SilverStripe\Control\Middleware\RequestHandlerMiddlewareAdapter
|
||||||
properties:
|
properties:
|
||||||
RequestHandler: %$MyController
|
RequestHandler: '%$MyController'
|
||||||
Middlewares:
|
Middlewares:
|
||||||
- %$CustomMiddleware
|
- '%$CustomMiddleware'
|
||||||
- %$AnotherMiddleware
|
- '%$AnotherMiddleware'
|
||||||
SilverStripe\Control\Director:
|
SilverStripe\Control\Director:
|
||||||
rules:
|
rules:
|
||||||
special\section:
|
special/section:
|
||||||
Controller: %$SpecialRouteMiddleware
|
Controller: '%$SpecialRouteMiddleware'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Application middleware
|
## Application middleware
|
||||||
|
Loading…
Reference in New Issue
Block a user