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


PHP Route::getCompiled方法代码示例

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


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

示例1: matches

 /**
  * Validate a given rule against a route and request.
  *
  * @param  \Illuminate\Routing\Route $route
  * @param  \Illuminate\Http\Request $request
  * @return bool
  */
 public function matches(Route $route, Request $request)
 {
     if (is_null($route->getCompiled()->getHostRegex())) {
         return true;
     }
     return preg_match($route->getCompiled()->getHostRegex(), $request->getHost());
 }
开发者ID:saj696,项目名称:pipe,代码行数:14,代码来源:HostValidator.php

示例2: matches

 /**
  * Validate a given rule against a route and request.
  *
  * @param  \Illuminate\Routing\Route $route
  * @param  \Illuminate\Http\Request $request
  *
  * @return bool
  */
 public function matches(Route $route, Request $request)
 {
     $regex = $route->getCompiled()->getRegex();
     if (str_contains($request->getRequestUri(), '/wp-admin')) {
         return preg_match(str_replace('$#s', '(?:&.+)?$#s', $regex), rawurldecode($request->getRequestUri()));
     }
     $path = $request->path() == '/' ? '/' : '/' . $request->path();
     return preg_match($regex, rawurldecode($path));
 }
开发者ID:lara-press,项目名称:framework,代码行数:17,代码来源:UriValidator.php

示例3: matches

 /**
  * Validate a given rule against a route and request.
  *
  * @param  LaravelRoute   $route   illuminate route
  * @param  LaravelRequest $request illuminate request
  *
  * @return bool
  */
 public function matches(Route $route, Request $request)
 {
     $path = $request->path() == '/' ? '/' : '/' . $request->path();
     $firstSegment = $request->segment(1);
     if ($firstSegment === null) {
         return true;
     } else {
         return preg_match($route->getCompiled()->getRegex(), rawurldecode($path));
     }
 }
开发者ID:mint-soft-com,项目名称:xpressengine,代码行数:18,代码来源:UriValidator.php

示例4: matches

 public function matches(Route $route, Request $request)
 {
     $path = $request->path() == '/' ? '/' : '/' . $request->path();
     return preg_match($route->getCompiled()->getRegex(), rawurldecode($path));
 }
开发者ID:devhrmx,项目名称:kraken,代码行数:5,代码来源:compiled.php

示例5: canReview

 /**
  * canReview
  *
  * @param Route   $route   laravel route
  * @param Request $request laravel request
  *
  * @return bool
  */
 private function canReview(Route $route, Request $request)
 {
     if (!is_null($route->getCompiled()->getHostRegex())) {
         return false;
     }
     $firstSegment = $request->segment(1);
     if ($firstSegment === null) {
         return true;
     }
     $uri = $route->uri();
     if (strpos($uri, '{') === false) {
         return false;
     }
     $actions = $route->getAction();
     if (isset($actions['module'])) {
         return true;
     }
     return false;
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:27,代码来源:ModuleValidator.php

示例6: getRouteIdentity

 /**
  * Transform route into string route identity
  *
  * @param Illuminate\Routing\Route $route
  * @return string formatted '<route_methods> <route_regex>'
  */
 protected function getRouteIdentity(Route $route)
 {
     $route->bind($this->app['request']);
     $regex = $route->getCompiled()->getRegex();
     $methods = implode('|', $route->getMethods());
     return $methods . ' ' . $regex;
 }
开发者ID:emsifa,项目名称:route-annotation,代码行数:13,代码来源:StandarizeRouteCommand.php


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