當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。