當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Route::parameterNames方法代碼示例

本文整理匯總了PHP中Illuminate\Routing\Route::parameterNames方法的典型用法代碼示例。如果您正苦於以下問題:PHP Route::parameterNames方法的具體用法?PHP Route::parameterNames怎麽用?PHP Route::parameterNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Routing\Route的用法示例。


在下文中一共展示了Route::parameterNames方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create

 /**
  * Create a new Redirect response.
  *
  * @param RedirectInterface $redirect
  * @return \Illuminate\Http\RedirectResponse
  */
 public function create(RedirectInterface $redirect)
 {
     $parameters = array_merge(array_map(function () {
         return null;
     }, array_flip($this->route->parameterNames())), $this->route->parameters());
     return $this->redirector->to($this->parser->parse($redirect->getTo(), $parameters), $redirect->getStatus(), [], $redirect->isSecure());
 }
開發者ID:JoelESvensson,項目名稱:redirects-module,代碼行數:13,代碼來源:RedirectResponse.php

示例2: create

 /**
  * Create a new Redirect response.
  *
  * @param RedirectInterface $redirect
  * @return \Illuminate\Http\RedirectResponse
  */
 public function create(RedirectInterface $redirect)
 {
     $parameters = array_merge(array_map(function () {
         return null;
     }, array_flip($this->route->parameterNames())), $this->route->parameters());
     if (!starts_with($url = $redirect->getTo(), ['http://', 'https://', '//'])) {
         $url = $this->url->to($redirect->getTo(), [], $redirect->isSecure());
     }
     return $this->redirector->to(rtrim($this->parser->parse($url, $parameters), '/'), $redirect->getStatus());
 }
開發者ID:visualturk,項目名稱:redirects-module,代碼行數:16,代碼來源:RedirectResponse.php

示例3: handle

 /**
  * Handle the command.
  *
  * @param RedirectRepositoryInterface $redirects
  * @param Redirector                  $redirector
  * @param Parser                      $parser
  * @param Route                       $route
  * @return \Illuminate\Http\RedirectResponse
  */
 public function handle(RedirectRepositoryInterface $redirects, Redirector $redirector, Parser $parser, Route $route)
 {
     $redirect = $redirects->find($this->id);
     $parameters = array_merge(array_map(function () {
         return null;
     }, array_flip($route->parameterNames())), $route->parameters());
     return $redirector->to($parser->parse($redirect->getTo(), $parameters), $redirect->getStatus(), [], $redirect->isSecure());
 }
開發者ID:AkibaTech,項目名稱:redirects-module,代碼行數:17,代碼來源:GetRedirectResponse.php

示例4: addParentIdsConditionsForDbObjectInjection

 /**
  * @param Route $route
  * @param CmfDbObject $object
  * @param array $conditions
  */
 protected function addParentIdsConditionsForDbObjectInjection(Route $route, CmfDbObject $object, array &$conditions)
 {
     foreach ($route->parameterNames() as $name) {
         if ($object->_hasField($name)) {
             $conditions[$name] = $route->parameter($name);
         }
     }
 }
開發者ID:swayok,項目名稱:PeskyCMF,代碼行數:13,代碼來源:InjectsDbObjects.php

示例5: hasParameters

 private function hasParameters(Route $route)
 {
     return count($route->parameterNames()) !== 0;
 }
開發者ID:herlevsen,項目名稱:laravel-route-bookmarker,代碼行數:4,代碼來源:RouteBookmarkerCommand.php

示例6: evaluateTemplated

 /**
  * @param Route $route
  * @param UrlGenerator $urlGenerator
  * @param $queryString
  * @return bool
  */
 private static function evaluateTemplated(Route $route, UrlGenerator $urlGenerator, $queryString)
 {
     // Does the route have named parameters? http://example.com/users/{users}
     if (count($route->parameterNames())) {
         return true;
     }
     $url = rawurldecode($urlGenerator->action($route->getActionName()));
     // Does the route's URI already contain a query string? http://example.com/users?page={page}&per_page={per_page}
     if (preg_match('/\\?.*=\\{.*?\\}/', $url)) {
         return true;
     }
     // Does the query string contain any parameters?
     if (preg_match('/\\?.*=\\{.*?\\}/', $queryString)) {
         return true;
     }
     return false;
 }
開發者ID:jarischaefer,項目名稱:hal-api,代碼行數:23,代碼來源:HalApiLinkImpl.php


注:本文中的Illuminate\Routing\Route::parameterNames方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。