<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## Route strategies路由策略 The route callback signature is determined by a route strategy. By default, Slim expects route callbacks to accept the request, response, and an array of route placeholder arguments. This is called the RequestResponse strategy. However, you can change the expected route callback signature by simply using a different strategy. As an example, Slim provides an alternative strategy called `RequestResponseArgs` that accepts request and response, plus each route placeholder as a separate argument. > 路由回調簽名由路由策略決定。 > > 默認情況下,Slim期望路由回調接受請求、響應和路由占位符參數數組。 > > 這稱為RequestResponse策略。 > > 但是,您可以通過簡單地使用不同的策略來更改預期的路由回調簽名。 > > 例如,Slim提供了一個名為`RequestResponseArgs`的替代策略,該策略接受請求和響應,并將每個路由占位符作為單獨的參數。 Here is an example of using this alternative strategy: > 下面是一個使用這種替代策略的例子: ~~~php <?php use Slim\Factory\AppFactory; use Slim\Handlers\Strategies\RequestResponseArgs; require __DIR__ . '/../vendor/autoload.php'; $app = AppFactory::create(); /** * 更改RouteCollector組件上的默認調用策略 * 在應用此更改后,將為每個定義的路由更改它 * Changing the default invocation strategy on the RouteCollector component * will change it for every route being defined after this change being applied */ $routeCollector = $app->getRouteCollector(); $routeCollector->setDefaultInvocationStrategy(new RequestResponseArgs()); $app->get('/hello/{name}', function ($request, $response, $name) { return $response->write($name); }); ~~~ Alternatively you can set a different invocation strategy on a per route basis: > 或者,您可以根據每個路由設置不同的調用策略: ~~~php <?php use Slim\Factory\AppFactory; use Slim\Handlers\Strategies\RequestResponseArgs; require __DIR__ . '/../vendor/autoload.php'; $app = AppFactory::create(); $routeCollector = $app->getRouteCollector(); $route = $app->get('/hello/{name}', function ($request, $response, $name) { return $response->write($name); }); $route->setInvocationStrategy(new RequestResponseArgs()); ~~~ You can provide your own route strategy by implementing the`Slim\Interfaces\InvocationStrategyInterface`. > 可以通過實現`Slim\Interfaces\InvocationStrategyInterface`來提供您自己的路由策略
                  <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>

                              哎呀哎呀视频在线观看