本文整理汇总了PHP中Illuminate\Routing\Route::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::getPath方法的具体用法?PHP Route::getPath怎么用?PHP Route::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Routing\Route
的用法示例。
在下文中一共展示了Route::getPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRouteInformation
/**
* Get the route information for a given route.
*
* @param string $name
* @param Route $route
* @param Route $current the current route
* @param string $base_path
* @return array
*/
protected function getRouteInformation($name, Route $route, $current, $base_path)
{
$path = $route->getPath();
$uri = head($route->getMethods()) . ' <a href="' . $base_path . $path . '">' . $path . '</a>';
$action = $route->getAction() ?: 'Closure';
return array('current' => $current == $route, 'host' => $route->getHost(), 'uri' => $uri, 'name' => $this->getRouteName($name), 'action' => $action, 'before' => $this->getBeforeFilters($route), 'after' => $this->getAfterFilters($route));
}
示例2: preparePath
protected function preparePath()
{
$path = $this->route->getPath();
if ($path === '/') {
return $path;
}
return trim($path, '/');
}
示例3: getPatternFilters
/**
* Get all of the pattern filters matching the route.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
protected function getPatternFilters($route)
{
$patterns = array();
foreach ($route->getMethods() as $method) {
$inner = $this->router->findPatternFilters($method, $route->getPath());
$patterns = array_merge($patterns, $inner);
}
return $patterns;
}
示例4: generateTableRow
private function generateTableRow(Route $route)
{
$tableRow = "";
$tableRow .= '<tr>';
$tableRow .= '<td>' . $route->getName() . '</td>';
$tableRow .= '<td><a href="' . $this->appUrl . '/' . $route->getUri() . '" target="_blank">' . $this->appUrl . '/' . $route->getPath() . '</a></td>';
$tableRow .= '</tr>';
return $tableRow;
}
示例5: forMissingParameters
/**
* Create a new exception for missing route parameters.
*
* @param \Illuminate\Routing\Route $route
* @return static
*/
public static function forMissingParameters($route)
{
return new static("Missing required parameters for [Route: {$route->getName()}] [URI: {$route->getPath()}].");
}
示例6: getPermissionKey
/**
* @param Route $route
* @param string $httpMethod
* @return string
*/
protected static function getPermissionKey(Route $route, $httpMethod)
{
// return str_pad($httpMethod, 6, ' ') . ' -> /' . ltrim($route->getPath(), '/');
return $httpMethod . '->' . $route->getPath();
}
示例7: checkPermission
/**
* @param Route $route
* @param EntrustUserInterface $user
* @return bool
*/
public function checkPermission(Route $route, EntrustUserInterface $user)
{
$action = $route->getName() ?: $route->getPath();
return $this->canAccess($action, $user);
}