當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。