當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。