Skip to content

Commit

Permalink
feat(BaseController, experimental): 增加 init 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Jun 29, 2023
1 parent 4fea229 commit 00fc885
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*
* @author Twin Huang <twinhuang@qq.com>
*
* @property Req $req A service that handles the HTTP request data
* @property Res $res A object that handles the HTTP response data
* @property Req $req A service that handles the HTTP request data
* @property Res $res A object that handles the HTTP response data
*/
abstract class BaseController extends Base
{
Expand Down Expand Up @@ -61,6 +61,15 @@ public function removeMiddleware(string $name): self
return $this;
}

/**
* Initialize the controller, can be used to register middleware
*
* @experimental
*/
public function init()
{
}

/**
* The callback triggered before execute the action
*
Expand Down

0 comments on commit 00fc885

Please sign in to comment.