本文整理汇总了PHP中Illuminate\Routing\Route::domain方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::domain方法的具体用法?PHP Route::domain怎么用?PHP Route::domain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Routing\Route
的用法示例。
在下文中一共展示了Route::domain方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToCollections
/**
* Add the given route to the arrays of routes.
*
* @param \Illuminate\Routing\Route $route
* @return void
*/
protected function addToCollections($route)
{
foreach ($route->methods() as $method) {
$this->routes[$method][$route->domain() . $route->getUri()] = $route;
}
$this->allRoutes[$method . $route->domain() . $route->getUri()] = $route;
}
示例2: getRouteInformation
/**
* Get the route information for a given route.
*
* @param $route \Illuminate\Routing\Route
* @param $filter string
* @param $namespace string
*
* @return array
*/
protected function getRouteInformation(Route $route, $filter, $namespace)
{
$host = $route->domain();
$methods = $route->getMethods();
$uri = $route->uri();
$name = $route->getName();
$action = $route->getActionName();
$jsroute = array_get($route->getAction(), 'jsroute', null);
if (!empty($namespace)) {
$a = $route->getAction();
if (isset($a['controller'])) {
$action = str_replace($namespace . '\\', '', $action);
}
}
switch ($filter) {
case 'all':
if ($jsroute === false) {
return null;
}
break;
case 'only':
if ($jsroute !== true) {
return null;
}
break;
}
return compact('host', 'methods', 'uri', 'name', 'action');
}
示例3: addToCollections
/**
* Add the given route to the arrays of routes.
*
* @param \Illuminate\Routing\Route $route
* @return void
*/
protected function addToCollections($route)
{
$domainAndUri = $route->domain() . $route->getUri() . $route->getPriority();
foreach ($route->methods() as $method) {
$this->routes[$method][$domainAndUri] = $route;
}
$this->allRoutes[$method . $domainAndUri] = $route;
}
示例4: getRouteDomain
/**
* Get the formatted domain for a given route.
*
* @param \Illuminate\Routing\Route $route
* @param array $parameters
* @return string
*/
protected function getRouteDomain($route, &$parameters)
{
return $route->domain() ? $this->formatDomain($route, $parameters) : null;
}
示例5: getRouteInformation
/**
* Get the route information for a given route.
*
* @param string $name
* @param \Illuminate\Routing\Route $route
* @return array
*/
protected function getRouteInformation(Route $route)
{
$uri = implode('|', $route->methods()) . ' ' . $route->uri();
return $this->filterRoute(array('host' => $route->domain(), 'uri' => $uri, 'name' => $route->getName(), 'action' => $route->getActionName(), 'before' => $this->getBeforeFilters($route), 'after' => $this->getAfterFilters($route)));
}
示例6: getRouteInformation
/**
* Get the route information for a given route.
*
* @param string $name
* @param \Symfony\Component\Routing\Route $route
* @return array
*/
protected function getRouteInformation($name, Route $route)
{
$uri = head($route->methods()) . ' ' . $route->uri();
return array('host' => (string) $route->domain(), 'method' => (string) $this->getMethod($uri), 'uri' => (string) $uri, 'name' => (string) $route->getName(), 'action' => (string) $route->getActionName(), 'before' => (string) $this->getBeforeFilters($route), 'after' => (string) $this->getAfterFilters($route));
}
示例7: getRouteInformation
/**
* Get the route information for a given route.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
protected function getRouteInformation(Route $route)
{
return $this->filterRoute(['host' => $route->domain(), 'method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName(), 'middleware' => $this->getMiddleware($route)]);
}
示例8: getRouteInformation
/**
* Get the route information for a given route.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
protected function getRouteInformation(Route $route)
{
return $this->filterRoute(array('host' => $route->domain(), 'uri' => implode('|', $route->methods()) . ' ' . $route->uri(), 'name' => $route->getName(), 'action' => $route->getActionName(), 'version' => implode(', ', array_get($route->getAction(), 'version')), 'protected' => array_get($route->getAction(), 'protected') ? 'Yes' : 'No', 'scopes' => $this->getScopes($route)));
}
示例9: getDomainAndScheme
/**
* Get the domain and schee for the route.
*
* @param \Illuminate\Routing\Route $route
* @return string
*/
protected function getDomainAndScheme($route)
{
return $this->getScheme($route->secure()) . $route->domain();
}
示例10: getRouteInformation
/**
* Get the route information for a given route.
*
* @param string $name
* @param \Illuminate\Routing\Route $route
* @return array
*/
protected function getRouteInformation(Route $route)
{
$uri = implode('|', $route->methods()) . ' ' . $route->uri();
return $this->filterRoute(array('host' => $route->domain(), 'uri' => $uri, 'name' => $route->getName(), 'action' => $route->getActionName(), 'prefix' => $route->getPrefix(), 'method' => $route->methods()[0]));
}
示例11: getRouteInformation
/**
* Get the route information for a given route.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
protected function getRouteInformation(Route $route)
{
list($controller, $action) = explode("@", $route->getActionName());
return ['host' => $route->domain(), 'method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'controller' => $controller, 'action' => $action, 'resource' => $route->getActionName(), 'middleware' => Collection::make($this->getMiddleware($route))];
}
示例12: toArray
/**
* @return array
*/
public function toArray()
{
return array_merge(['name' => $this->route->getName(), 'methods' => $this->route->getMethods(), 'domain' => $this->route->domain(), 'path' => $this->preparePath(), 'action' => $this->route->getAction(), 'wheres' => $this->extractWheres(), 'errors' => $this->errors], $this->getMeta(), $this->options);
}
示例13: getRouteInformation
protected function getRouteInformation(Route $route, $current)
{
$uri = implode(' | ', $route->methods()) . ' <a href="' . $this->url->to($route->uri()) . '">' . $route->uri() . '</a>';
return array('current' => $current == $route, 'host' => $route->domain(), 'uri' => $uri, 'name' => $route->getName(), 'action' => $route->getActionName(), 'before' => $this->getBeforeFilters($route), 'after' => $this->getAfterFilters($route));
}