<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 控制器中間件 支持為控制器定義中間件,你只需要在你的控制器中定義`middleware`屬性,例如: ~~~ <?php namespace app\controller; use app\middleware\Auth; class Index { protected $middleware = [Auth::class]; public function index() { return 'index'; } public function hello() { return 'hello'; } } ~~~ 當執行`index`控制器的時候就會調用`Auth`中間件,一樣支持使用完整的命名空間定義。 如果需要設置控制器中間的生效操作,可以如下定義: ~~~ <?php namespace app\index\controller; class Index { protected $middleware = [ Auth::class . ':admin' => ['except' => ['hello'] ], 'Hello' => ['only' => ['hello'] ], ]; public function index() { return 'index'; } public function hello() { return 'hello'; } } ~~~ ## 中間件傳參 如果需要給中間件傳參,可以的定義的時候使用 ~~~ <?php namespace app\controller; class Index { protected $middleware = ['Auth']; public function index() { return 'index'; } public function hello() { return 'hello'; } } ~~~ ## 控制器傳參 可以通過給請求對象賦值的方式傳參給控制器(或者其它地方),例如 ~~~ <?php namespace app\http\middleware; class Hello { public function handle($request, \Closure $next) { $request->hello = 'ThinkPHP'; return $next($request); } } ~~~ 然后在控制器的方法里面可以直接使用 ~~~ public function index(Request $request) { return $request->hello; // ThinkPHP } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看