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


PHP Router::findRoute方法代码示例

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


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

示例1: findRoute

 /**
  * Find the route matching a given request.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Themosis\Route\Route
  */
 protected function findRoute($request)
 {
     $route = parent::findRoute($request);
     // If the current route is a WordPress route
     if ($route instanceof Route && !$route->condition()) {
         global $wp, $wp_query;
         //Check if the route is not a WordPress route and warn the developer to flush the rewrite rules.
         if ($wp->matched_rule != $route->getRewriteRuleRegex()) {
             /*
              * We cannot rely on the flush_rewrite_rules() function as it's a heavy process
              * especially on a per-request manner.
              * We modify the headers status and set to 200 so it is properly handled.
              * We need to use WordPress headers functions as we only return the response
              * content on each request.
              */
             status_header(200, 'OK');
         }
         // Reset the WordPress query.
         $wp_query->init();
     }
     return $route;
 }
开发者ID:themosis,项目名称:framework,代码行数:28,代码来源:Router.php

示例2: findRoute

 /**
  * Find a route either from the routers collection or the API collection.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Routing\Route
  */
 protected function findRoute($request)
 {
     if ($this->requestTargettingApi($request)) {
         list($this->requestedVersion, $this->requestedFormat) = $this->parseAcceptHeader($request);
         $this->current = $route = $this->getApiRouteCollection($this->requestedVersion)->match($request);
         return $this->substituteBindings($route);
     }
     return parent::findRoute($request);
 }
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:15,代码来源:Router.php

示例3: findRoute

 protected function findRoute($request)
 {
     return parent::findRoute($request);
 }
开发者ID:michaeljhopkins,项目名称:alexa-app,代码行数:4,代码来源:AlexaRouter.php


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