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