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


PHP Bundle::handles方法代码示例

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


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

示例1: __construct

 /**
  * Create a new Route instance.
  *
  * @param  string  $method
  * @param  string  $uri
  * @param  array   $action
  * @param  array   $parameters
  */
 public function __construct($method, $uri, $action, $parameters = array())
 {
     $this->uri = $uri;
     $this->method = $method;
     $this->action = $action;
     // Determine the bundle in which the route was registered. We will know
     // the bundle by using the bundle::handles method, which will return
     // the bundle assigned to that URI.
     $this->bundle = Bundle::handles($uri);
     // We'll set the parameters based on the number of parameters passed
     // compared to the parameters that were needed. If more parameters
     // are needed, we'll merge in defaults.
     $this->parameters($action, $parameters);
 }
开发者ID:nenoraith,项目名称:sowcomposer,代码行数:22,代码来源:route.php

示例2: route

 /**
  * Search the routes for the route matching a method and URI.
  *
  * @param  string   $method
  * @param  string   $uri
  * @return Route
  */
 public static function route($method, $uri)
 {
     Bundle::start($bundle = Bundle::handles($uri));
     $routes = (array) static::method($method);
     // Of course literal route matches are the quickest to find, so we will
     // check for those first. If the destination key exists in the routes
     // array we can just return that route now.
     if (array_key_exists($uri, $routes)) {
         $action = $routes[$uri];
         return new Route($method, $uri, $action);
     }
     // If we can't find a literal match we'll iterate through all of the
     // registered routes to find a matching route based on the route's
     // regular expressions and wildcards.
     if (!is_null($route = static::match($method, $uri))) {
         return $route;
     }
 }
开发者ID:shawon922,项目名称:LaravelBackboneTodoMVC,代码行数:25,代码来源:router.php

示例3: route

 public static function route($method, $uri)
 {
     Bundle::start($bundle = Bundle::handles($uri));
     $routes = (array) static::method($method);
     if (array_key_exists($uri, $routes)) {
         $action = $routes[$uri];
         return new Route($method, $uri, $action);
     }
     if (!is_null($route = static::match($method, $uri))) {
         return $route;
     }
 }
开发者ID:laravelbook,项目名称:framework3,代码行数:12,代码来源:laravel_lite.php


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