當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Router::createRoute方法代碼示例

本文整理匯總了PHP中Illuminate\Routing\Router::createRoute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Router::createRoute方法的具體用法?PHP Router::createRoute怎麽用?PHP Router::createRoute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Routing\Router的用法示例。


在下文中一共展示了Router::createRoute方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createRoute

 /**
  * Create a new route instance.
  *
  * @param  array|string  $methods
  * @param  string  $uri
  * @param  mixed   $action
  * @return \Illuminate\Routing\Route
  */
 protected function createRoute($methods, $uri, $action)
 {
     $route = parent::createRoute($methods, $uri, $action);
     if (!empty($this->groupStack)) {
         $this->mergePriority($route);
     }
     return $route;
 }
開發者ID:sleeping-owl,項目名稱:route-priority,代碼行數:16,代碼來源:Router.php

示例2: createRoute

 /**
  *	createRoute
  *
  *	Additions to default routing class method createRoute.
  *
  *	@param string $method
  *	@param string $pattern
  *	@param callable $action
  *
  *	@return array
  */
 protected function createRoute($method, $pattern, $action)
 {
     if (is_array($action) === true && array_key_exists('as', $action) === true) {
         $alias = $action['as'];
         $callback = $action['uses'];
     } else {
         $alias = null;
         $callback = $action;
     }
     $this->namedRouteObjects[$pattern] = (object) ['alias' => $alias, 'method' => $method, 'callback' => $callback];
     return parent::createRoute($method, $pattern, $action);
 }
開發者ID:carbincreative,項目名稱:postmark,代碼行數:23,代碼來源:Router.php

示例3: createRoute

 /**
  * Create a new route instance.
  * 
  * @param  array|string $methods
  * @param  string       $uri
  * @param  mixed        $action
  * @return \Illuminate\Routing\Route
  */
 public function createRoute($methods, $uri, $action)
 {
     if ($this->isApiLastGroup()) {
         $uri = $this->suffix($uri);
     }
     return parent::createRoute($methods, $uri, $action);
 }
開發者ID:peakfijn,項目名稱:get-some-rest,代碼行數:15,代碼來源:Router.php


注:本文中的Illuminate\Routing\Router::createRoute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。