php-sroute icon indicating copy to clipboard operation
php-sroute copied to clipboard

中间件怎么使用呢,在哪里定义?

Open wangcong099878 opened this issue 5 years ago • 1 comments

    $router->group('/grp', function (Router $r) use (&$r1) {
        $r1 = $r->get('/path', 'h0')->push('func2');
    }, ['func3', 'func4'], ['n1' => 'v1']);

例如func3,传进去的是字符串吗,在哪里注册的

wangcong099878 avatar Nov 10 '20 08:11 wangcong099878

func3 是指的函数名称。

现在是支持添加中间件,匹配到路由会把这些中间件带上。但是不会自动调度,需要你自己手动调度他们。

后续我增强下,支持自动调度。

inhere avatar Nov 13 '20 06:11 inhere