当前位置: 首页>>代码示例>>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;未经允许,请勿转载。