当前位置: 首页>>代码示例>>PHP>>正文


PHP Route::getPath方法代码示例

本文整理汇总了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));
 }
开发者ID:onigoetz,项目名称:profiler,代码行数:16,代码来源:RouterDataCollector.php

示例2: preparePath

 protected function preparePath()
 {
     $path = $this->route->getPath();
     if ($path === '/') {
         return $path;
     }
     return trim($path, '/');
 }
开发者ID:asvae,项目名称:laravel-api-tester,代码行数:8,代码来源:RouteInfo.php

示例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;
 }
开发者ID:arizawan,项目名称:livetvwithyoutube,代码行数:15,代码来源:SymfonyRouteCollector.php

示例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;
 }
开发者ID:herlevsen,项目名称:laravel-route-bookmarker,代码行数:9,代码来源:RouteBookmarkerCommand.php

示例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()}].");
 }
开发者ID:saj696,项目名称:pipe,代码行数:10,代码来源:UrlGenerationException.php

示例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();
 }
开发者ID:swayok,项目名称:PeskyCMF,代码行数:10,代码来源:BaseAccessManager.php

示例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);
 }
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:10,代码来源:AdminAuthMiddleware.php


注:本文中的Illuminate\Routing\Route::getPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。