本文整理汇总了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);
}
示例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;
}
}
示例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;
}
}