mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Make RequestProcessor->filters settable as a property too
filters was a DI property that could only be set via constructor. This meant that modules couldnt add a filter without interfering with other modules. With this change you can now add a config block like: Injector: RequestProcessor: properties: filters: - "%$MyFilter" Which will add a filter to RequestProcessors list of filters
This commit is contained in:
parent
09067cc8dd
commit
35cc65820c
@ -14,6 +14,10 @@ class RequestProcessor {
|
|||||||
$this->filters = $filters;
|
$this->filters = $filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setFilters($filters) {
|
||||||
|
$this->filters = $filters;
|
||||||
|
}
|
||||||
|
|
||||||
public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) {
|
public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) {
|
||||||
foreach ($this->filters as $filter) {
|
foreach ($this->filters as $filter) {
|
||||||
$res = $filter->preRequest($request, $session, $model);
|
$res = $filter->preRequest($request, $session, $model);
|
||||||
|
Loading…
Reference in New Issue
Block a user