The function of tp5.0 is similar to that of middleware.

1. Is the tp5.0 version, want to use functions similar to laravel middleware
2. After checking Baidu, tp seems to have a similar behavior, but does not quite understand
3. I have tried to use postposition behavior in routing, but if there are multiple routes, it is troublesome to add one by one
4.Route::post ("api/:version/test","api/:version.Index/test", [" after_behavior"= > "appapicontrollerv1LoginBase"]);
5. Do not want to write a base class to verify, and then other classes inherit this, so I hope to give an example or other directions to provide ideas

Apr.26,2021

behavior, which is what you call behavior, can be set uniformly under tag.php.


@ fgmy how to solve it? I use the hook, it still seems that the parameters do not know how to pass the forehead. Now I have the same problem as you

Menu