You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .vaseman/entries/documentation/mvc/use-controller.md
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Use Controller
6
6
# Controller Overview
7
7
8
8
Windwalker Controller is a main entry of a page, after routing, the request input and IoC container will be injected
9
-
into controller and execute it. Every our code of this page will start at `doExecute()`.
9
+
into controller and execute it. Any code mentioned in this section will be executed in `doExecute()`, the entrance of controller.
10
10
11
11
Simple usage of controller:
12
12
@@ -30,14 +30,13 @@ class GetController extends Controller
30
30
## Single Action Pattern
31
31
32
32
Windwalker Controller follows single responsibility principle, every controller has only one action (`execute()`).
33
-
The benefit is that our controllers will be more lighter then other frameworks. You can add more logic to a controller but won't be
34
-
confused by many actions in one class.
33
+
The benefit is that our controllers will be much more lighter then other frameworks. You can add more logic to a controller without being confused by too many actions in one class.
35
34
36
35
## Use Multiple Actions
37
36
38
37
But if you want to use multiple actions like traditional practice, Windwalker also support it.
39
38
40
-
First, your controller should extends to`MultiActionController`:
39
+
First, your controller should extend from`MultiActionController`:
41
40
42
41
```php
43
42
use Flower\Controller\Sakura\SakuraController;
@@ -72,8 +71,6 @@ flower:
72
71
73
72
The action prefix with double colons will be methods of your controller.
74
73
75
-
> NOTE: There is a found bug of MultiActionController in 2.0.3 that make it not work, we'll fix it soon after next version.
76
-
77
74
# Get HTTP Input
78
75
79
76
See: [Request and Input](../start/request-input.html), we can use Input object to get HTTP queries:
0 commit comments