File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
user_guide_src/source/incoming Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,29 @@ but may leave the methods empty if they are not needed. A skeleton filter class
32
32
Before Filters
33
33
==============
34
34
35
+ Replacing Request
36
+ -----------------
37
+
35
38
From any filter, you can return the ``$request `` object and it will replace the current Request, allowing you
36
39
to make changes that will still be present when the controller executes.
37
40
38
- Since before filters are executed prior to your controller being executed, you may at times want to stop the
39
- actions in the controller from happening. Also, when you have a series of filters you may also want to
41
+ Stopping Later Filters
42
+ ----------------------
43
+
44
+ Also, when you have a series of filters you may also want to
40
45
stop the execution of the later filters after a certain filter. You can easily do this by returning
41
46
**any non-empty ** result. If the before filter returns an empty result, the controller actions or the later
42
- filters will still be executed. An exception to the non-empty result rule is the ``Request `` instance.
47
+ filters will still be executed.
48
+
49
+ An exception to the non-empty result rule is the ``Request `` instance.
43
50
Returning it in the before filter will not stop the execution but only replace the current ``$request `` object.
44
51
52
+ Returning Response
53
+ ------------------
54
+
55
+ Since before filters are executed prior to your controller being executed, you may at times want to stop the
56
+ actions in the controller from happening.
57
+
45
58
This is typically used to perform redirects, like in this example:
46
59
47
60
.. literalinclude :: filters/002.php
You can’t perform that action at this time.
0 commit comments