当前位置: 首页>>代码示例>>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;未经允许,请勿转载。