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