本文整理汇总了PHP中Illuminate\Routing\Route::setAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::setAction方法的具体用法?PHP Route::setAction怎么用?PHP Route::setAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Routing\Route
的用法示例。
在下文中一共展示了Route::setAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mergeGroupAttributesIntoRoute
/**
* Merge the group stack with the controller action.
*
* @param \Illuminate\Routing\Route $route
* @return void
*/
protected function mergeGroupAttributesIntoRoute($route)
{
$action = $this->mergeWithLastGroup($route->getAction());
$route->setAction($action);
}
示例2: addApiRoute
/**
* Add a new route to an API collection.
*
* @param \Illuminate\Routing\Route $route
* @return \Illuminate\Routing\Route
*/
protected function addApiRoute($route)
{
// Since the groups action gets merged with the routes we need to make
// sure that if the route supplied its own protection that we grab
// that protection status from the array after the merge.
$action = $route->getAction();
if (count($this->groupStack) > 0 and isset($action['protected'])) {
$action['protected'] = is_array($action['protected']) ? last($action['protected']) : $action['protected'];
$route->setAction($action);
}
$versions = array_get(last($this->groupStack), 'version', []);
foreach ($versions as $version) {
if ($collection = $this->getApiRouteCollection($version)) {
$collection->add($route);
}
}
return $route;
}
示例3: mergeController
/**
* Merge the group stack with the controller action.
*
* @param \Illuminate\Routing\Route $route
* @return void
*/
protected function mergeController($route)
{
$action = $this->mergeWithLastGroup($route->getAction());
$route->setAction($action);
}
示例4: setAction
/**
* {@inheritDoc}
*/
public function setAction(array $action)
{
$action = static::parseAction($action);
return parent::setAction($action);
}