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


PHP Router::match方法代码示例

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


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

示例1: registerRoutes

 /**
  * Register routes from an array
  *
  * @param array $data
  *
  * @return void
  */
 protected function registerRoutes(array $data)
 {
     foreach ($data as $method => $routes) {
         if (in_array($method, $this->verbs)) {
             foreach ($routes as $uri => $action) {
                 $this->router->match(array($method), $uri, $action);
             }
         }
     }
 }
开发者ID:fire015,项目名称:json-routes,代码行数:17,代码来源:Router.php

示例2: let

 function let(Repository $config, Filesystem $fs, OutputInterface $output)
 {
     $config_file = (include __DIR__ . '/../../src/config/path2api.php');
     $this->tempFile = $config_file['file'];
     $config->get('path2api')->willReturn($config_file);
     $router = new Router(new Dispatcher());
     $router->get('/api', ['uses' => 'Stubs\\Pomek\\Path2API\\Controller@homepage']);
     $router->post('/api/contact/{email}', ['uses' => 'Stubs\\Pomek\\Path2API\\Controller@contact']);
     $router->match(['GET', 'POST'], '/api/test/{id}', function ($id) {
         return $id;
     });
     $this->beConstructedWith($router, $config, $fs);
     $this->setOutput($output);
 }
开发者ID:pomek,项目名称:path2api,代码行数:14,代码来源:GenerateDocsConsoleSpec.php

示例3: makeAndRegisterRoute

 /**
  * Make route from route data and register it into router
  *
  * @param array $route_data
  * @param string $controller
  * @return Illuminate\Routing\Route
  */
 protected function makeAndRegisterRoute($controller, ReflectionMethod $method, array $route_data)
 {
     $uses = $controller . '@' . $method->getName();
     $methods = $route_data['methods'];
     $uri = $route_data['uri'];
     $action = ['uses' => $uses];
     if (!empty($route_data['middleware'])) {
         $action['middleware'] = $route_data['middleware'];
     }
     if (!empty($route_data['name'])) {
         $action['as'] = $route_data['name'];
     }
     $route = $this->router->match($methods, $uri, $action);
     foreach ($route_data['conditions'] as $param => $regex) {
         $route->where($param, $regex);
     }
     // Laravel Route doesn't provide method for get route conditions,
     // so we need to declare new attribute for generating(transforming) purpose
     $route->conditions = $route_data['conditions'];
     $route->description = $route_data['description'];
     return $route;
 }
开发者ID:emsifa,项目名称:route-annotation,代码行数:29,代码来源:RouteAnnotator.php

示例4: match

 /**
  * Register a new route with the given verbs.
  *
  * @param array|string $methods
  * @param string $uri
  * @param \Closure|array|string $action
  * @return \Illuminate\Routing\Route 
  * @static 
  */
 public static function match($methods, $uri, $action)
 {
     return \Illuminate\Routing\Router::match($methods, $uri, $action);
 }
开发者ID:satriashp,项目名称:tour,代码行数:13,代码来源:_ide_helper.php

示例5: match

 /**
  * Register a new route with the given verbs.
  *
  * @param  array|string           $methods
  * @param  string                 $uri
  * @param  \Closure|array|string  $action
  *
  * @return \Illuminate\Routing\Route|void
  */
 public function match($methods, $uri, $action)
 {
     return $this->router->match($methods, $uri, $action);
 }
开发者ID:arcanedev,项目名称:support,代码行数:13,代码来源:RouteRegister.php

示例6: inject

 /**
  * Inject routes into the provided router.
  *
  * @param Router $router
  * @return Router
  */
 public function inject(Router $router)
 {
     $router->group(Arr::filterNullValues(['middleware' => $this->middleware, 'prefix' => $this->prefix]), function (Router $router) {
         Std::each(function (ResourceMethod $method) use($router) {
             $handler = vsprintf('%s@%s', [$this->controller, $method->getMethod()]);
             $router->match([$method->getVerb()], $method->getPath(), $handler);
         }, $this->methods);
     });
     return $router;
 }
开发者ID:sellerlabs,项目名称:illuminated,代码行数:16,代码来源:ResourceFactory.php

示例7: addResourceUpdate

 /**
  * Add the update method for a resourceful route.
  *
  * @param  string  $name
  * @param  string  $base
  * @param  string  $controller
  * @param  array   $options
  * @return void
  */
 protected function addResourceUpdate($name, $base, $controller, $options)
 {
     $uri = $this->getResourceUri($name) . '/{' . $base . '}';
     $action = $this->getResourceAction($name, $controller, 'update', $options);
     return $this->router->match(['PUT', 'PATCH'], $uri, $action);
 }
开发者ID:chriss-inno,项目名称:misscontest,代码行数:15,代码来源:ResourceRegistrar.php

示例8: match

 /**
  * Register a new route with the given verbs.
  *
  * @param  array|string  $methods
  * @param  string  $uri
  * @param  \Closure|array|string|null  $action
  * @return \Illuminate\Routing\Route
  */
 public function match($methods, $uri, $action = null)
 {
     return $this->router->match($methods, $uri, $this->compileAction($action));
 }
开发者ID:jarnovanleeuwen,项目名称:framework,代码行数:12,代码来源:RouteRegistrar.php

示例9: addSymfonyRoutes

 /**
  * Expose symfonys routes to Laravel.
  *
  * @param Router $router
  */
 public function addSymfonyRoutes(Router $router)
 {
     foreach ($this->routesFromSymfony as $route) {
         $router->match($route['methods'], $route['path'], $route['action']);
     }
 }
开发者ID:SerdarSanri,项目名称:symfony-facade,代码行数:11,代码来源:SymfonyRoutesManager.php


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