Home >Backend Development >PHP Tutorial >laravel中间件中的Closure $next是什么意思

laravel中间件中的Closure $next是什么意思

WBOY
WBOYOriginal
2016-06-06 20:17:492708browse

<code>public function handle($request, Closure $next)
{
    if ($request->input('age') </code>

Closure $next定义了一个匿名函数,但是调用的时候也得传一个匿名函数给$next啊,怎么在实际代码中传给$next的究竟是个怎么样的匿名函数呢


请移步:https://segmentfault.com/q/1010000004272826

这个问题已被关闭,原因:与已有问题重复

回复内容:

<code>public function handle($request, Closure $next)
{
    if ($request->input('age') </code>

Closure $next定义了一个匿名函数,但是调用的时候也得传一个匿名函数给$next啊,怎么在实际代码中传给$next的究竟是个怎么样的匿名函数呢


请移步:https://segmentfault.com/q/1010000004272826

将request传给下一个middleware

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn