本文整理匯總了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);
}