当前位置: 首页>>代码示例>>PHP>>正文


PHP Router::prepare方法代码示例

本文整理汇总了PHP中Illuminate\Routing\Router::prepare方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::prepare方法的具体用法?PHP Router::prepare怎么用?PHP Router::prepare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Routing\Router的用法示例。


在下文中一共展示了Router::prepare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Execute the route and return the response.
  *
  * @param  \Symfony\Component\HttpFoundation\Request  $request
  * @return mixed
  */
 public function run(Request $request)
 {
     $this->parsedParameters = null;
     // We will only call the router callable if no "before" middlewares returned
     // a response. If they do, we will consider that the response to requests
     // so that the request "lifecycle" will be easily halted for filtering.
     $response = $this->callBeforeFilters($request);
     if (!isset($response)) {
         $response = $this->callCallable();
     } else {
         $fromFilter = true;
     }
     $response = $this->router->prepare($response, $request);
     // Once we have the "prepared" response, we will iterate through every after
     // filter and call each of them with the request and the response so they
     // can perform any final work that needs to be done after a route call.
     if (!isset($fromFilter)) {
         $this->callAfterFilters($request, $response);
     }
     return $response;
 }
开发者ID:shinichi81,项目名称:laravel4demo,代码行数:27,代码来源:Route.php

示例2: processResponse

 /**
  * Process a controller action response.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @param  string  $method
  * @param  mixed   $response
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function processResponse($router, $method, $response)
 {
     $request = $router->getRequest();
     // The after filters give the developers one last chance to do any last minute
     // processing on the response. The response has already been converted to a
     // full Response object and will also be handed off to the after filters.
     $response = $router->prepare($response, $request);
     $this->callAfterFilters($router, $method, $response);
     return $response;
 }
开发者ID:shinichi81,项目名称:laravel4demo,代码行数:18,代码来源:Controller.php


注:本文中的Illuminate\Routing\Router::prepare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。