當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Route::methods方法代碼示例

本文整理匯總了PHP中Illuminate\Routing\Route::methods方法的典型用法代碼示例。如果您正苦於以下問題:PHP Route::methods方法的具體用法?PHP Route::methods怎麽用?PHP Route::methods使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Routing\Route的用法示例。


在下文中一共展示了Route::methods方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: filterRouteAsClass

 protected function filterRouteAsClass(Route $route)
 {
     if ($this->option('name') && !str_contains($route->getName(), $this->option('name')) || $this->option('path') && !str_contains(implode('|', $route->methods()) . ' ' . $route->uri(), $this->option('path'))) {
         return null;
     }
     return $route;
 }
開發者ID:fisdap,項目名稱:laravel-console-extensions,代碼行數:7,代碼來源:RouteFiltersListCommand.php

示例2: addToCollections

 /**
  * Add the given route to the arrays of routes.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return void
  */
 protected function addToCollections($route)
 {
     foreach ($route->methods() as $method) {
         $this->routes[$method][$route->domain() . $route->getUri()] = $route;
     }
     $this->allRoutes[$method . $route->domain() . $route->getUri()] = $route;
 }
開發者ID:ahumellihuk,項目名稱:blogging-platform,代碼行數:13,代碼來源:RouteCollection.php

示例3: addToCollections

 /**
  * Add the given route to the arrays of routes.
  *
  * @param  \Illuminate\Routing\Route $route
  * @return void
  */
 protected function addToCollections($route)
 {
     $domainAndUri = $route->domain() . $route->getUri() . $route->getPriority();
     foreach ($route->methods() as $method) {
         $this->routes[$method][$domainAndUri] = $route;
     }
     $this->allRoutes[$method . $domainAndUri] = $route;
 }
開發者ID:langaner,項目名稱:route-priority,代碼行數:14,代碼來源:RouteCollection.php

示例4: getPatternFilters

 /**
  * Get all of the pattern filters matching the route.
  *
  * @param  \Illuminate\Routing\Route $route
  * @return array
  */
 protected function getPatternFilters($route)
 {
     $patterns = array();
     foreach ($route->methods() as $method) {
         // For each method supported by the route we will need to gather up the patterned
         // filters for that method. We will then merge these in with the other filters
         // we have already gathered up then return them back out to these consumers.
         $inner = $this->getMethodPatterns($route->uri(), $method);
         $patterns = array_merge($patterns, array_keys($inner));
     }
     return $patterns;
 }
開發者ID:jairoserrano,項目名稱:SimpleBlogClase,代碼行數:18,代碼來源:IlluminateRouteCollector.php

示例5: isAlternate

 public function isAlternate(LaravelRoute $route)
 {
     if (!$route instanceof Route) {
         return false;
     }
     // Validate methods
     if ($this->methods() != $route->methods()) {
         return false;
     }
     // Validate scheme
     if ($this->httpOnly() !== $route->httpOnly()) {
         return false;
     }
     // Validate base uri
     if ($this->getBaseUri() !== $route->getBaseUri()) {
         return false;
     }
     if ($this->getUri() === $route->getUri()) {
         return false;
     }
     return true;
 }
開發者ID:exolnet,項目名稱:laravel-routing,代碼行數:22,代碼來源:Route.php

示例6: 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)
 {
     return in_array($request->getMethod(), $route->methods());
 }
開發者ID:flelievre,項目名稱:EasyVisit,代碼行數:11,代碼來源:MethodValidator.php

示例7: getRouteInformation

 protected function getRouteInformation(Route $route)
 {
     $uri = implode('|', $route->methods()) . ' ' . $route->uri();
     return $this->filterRoute(['uri' => $uri, 'name' => $route->getName(), 'before' => $this->getBeforeFilters($route), 'after' => $this->getAfterFilters($route)]);
 }
開發者ID:fisdap,項目名稱:laravel-console-extensions,代碼行數:5,代碼來源:RouteFiltersDetailCommand.php

示例8: getRouteInformation

 /**
  * @param \Illuminate\Routing\Route $route
  *
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return $this->filterRoute(['host' => $route->domain(), 'method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName(), 'middleware' => $this->getMiddleware($route)]);
 }
開發者ID:notadd,項目名稱:framework,代碼行數:9,代碼來源:RouteListCommand.php

示例9: getRouteInformation

 /**
  * Get the route information for a given route.
  *
  * @param \Illuminate\Routing\Route $route
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return $this->filterRoute(array('host' => $route->domain(), 'uri' => implode('|', $route->methods()) . ' ' . $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName(), 'version' => implode(', ', array_get($route->getAction(), 'version')), 'protected' => array_get($route->getAction(), 'protected') ? 'Yes' : 'No', 'scopes' => $this->getScopes($route)));
 }
開發者ID:andymrussell,項目名稱:api,代碼行數:10,代碼來源:ApiRoutesCommand.php

示例10: getPatternFilters

 /**
  * Get all of the pattern filters matching the route.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 protected function getPatternFilters($route)
 {
     $patterns = [];
     foreach ($route->methods() as $method) {
         $inner = $this->getMethodPatterns($route->uri(), $method);
         $patterns = array_merge($patterns, array_keys($inner));
     }
     return $patterns;
 }
開發者ID:fedeisas,項目名稱:laravel-js-routes,代碼行數:15,代碼來源:RoutesJavascriptGenerator.php

示例11: getRouteInformation

 /**
  * Get the route information for a given route.
  *
  * @param  string  $name
  * @param  \Illuminate\Routing\Route  $route
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     $uri = implode('|', $route->methods()) . ' ' . $route->uri();
     return $this->filterRoute(array('host' => $route->domain(), 'uri' => $uri, 'name' => $route->getName(), 'action' => $route->getActionName(), 'prefix' => $route->getPrefix(), 'method' => $route->methods()[0]));
 }
開發者ID:f2m2,項目名稱:apidocs,代碼行數:12,代碼來源:ApiDocsGenerator.php

示例12: getRouteInformation

 /**
  * @param Route $route
  *
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return ['method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName()];
 }
開發者ID:laravel-jp-reference,項目名稱:chapter8,代碼行數:9,代碼來源:RouteService.php

示例13: getRouteMethod

 private function getRouteMethod(Route $route)
 {
     $methods = $route->methods();
     return Arr::first($methods);
 }
開發者ID:gez-studio,項目名稱:gez-mall,代碼行數:5,代碼來源:RequestTestCase.php

示例14: getRouteInformation

 /**
  * Get the route information for a given route.
  *
  * @param  \Illuminate\Routing\Route $route
  * @return array
  */
 protected function getRouteInformation(Route $route)
 {
     return $this->filterRoute(['uri' => $route->uri(), 'methods' => $route->methods(), 'name' => $route->getName(), 'action' => $route->getActionName()]);
 }
開發者ID:pomek,項目名稱:path2api,代碼行數:10,代碼來源:GenerateDocsConsole.php


注:本文中的Illuminate\Routing\Route::methods方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。