Heim  >  Artikel  >  Backend-Entwicklung  >  laravel中间件中的Closure $next是什么意思

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

WBOY
WBOYOriginal
2016-06-06 20:17:492666Durchsuche

<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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn