Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions resource/doc/en/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,15 @@ Route::group('/blog', function () {
> **Note**
> This feature requires webman-framework >= 1.4.8

Starting from version 1.4.8, the configuration file supports instantiating middleware directly or using anonymous functions, making it easy to pass parameters to the middleware through the constructor.
Starting from version 1.4.8, the configuration file supports instantiating middleware directly, making it easy to pass parameters to the middleware through the constructor.
For example, you can also configure the `config/middleware.php` as follows:

```php
return [
// Global middleware
'' => [
new app\middleware\AuthCheckTest($param1, $param2, ...),
function(){
return new app\middleware\AccessControlTest($param1, $param2, ...);
},
new app\middleware\AccessControlTest($param1, $param2, ...)
],
// Application middleware (only effective in multi-application mode)
'api' => [
Expand Down
2 changes: 1 addition & 1 deletion resource/doc/zh-cn/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ $request->file();

表单类似:
```html
<form method="post" action="http://127.0.0.1:8787/upload/files" enctype="multipart/form-data" />
<form method="post" action="http://127.0.0.1:8787/upload/files" enctype="multipart/form-data">
<input name="file1" multiple="multiple" type="file">
<input name="file2" multiple="multiple" type="file">
<input type="submit">
Expand Down