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


PHP Route::getParameter方法代码示例

本文整理汇总了PHP中Illuminate\Routing\Route::getParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::getParameter方法的具体用法?PHP Route::getParameter怎么用?PHP Route::getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Routing\Route的用法示例。


在下文中一共展示了Route::getParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $rules = $this->createRequest->rules();
     $rules['username'] .= ',username,' . $this->route->getParameter('users') . ',id';
     $rules['password'] = 'confirmed';
     return $rules;
 }
开发者ID:NuestraMarca,项目名称:tenderos,代码行数:12,代码来源:EditRequest.php

示例2: validateShowPath

 /**
  * Validates show path.
  * @param Route $route
  * @return Response
  */
 public function validateShowPath(Route $route)
 {
     $org = $route->getParameter('organisations');
     $attr = $route->getParameter('attrs');
     if ($attr->organisation_id !== $org->id) {
         return Response::json(null, 404);
     }
 }
开发者ID:ryansmith94,项目名称:laradash,代码行数:13,代码来源:AttrsController.php

示例3: find

 public function find(Route $route)
 {
     if ($route->getParameter('inventario')) {
         $codigo = $route->getParameter('inventario');
     } else {
         $codigo = $route->getParameter('id');
     }
     $this->datos = Inventario::find($codigo);
     $this->notFound($this->datos);
 }
开发者ID:jlobaton,项目名称:inventario,代码行数:10,代码来源:InventarioController.php

示例4: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $id = $this->route->getParameter('tenderos');
     if (is_null($id)) {
         $id = $this->route->getParameter('productores');
     }
     $rules = $this->createRequest->rules();
     $rules['username'] .= ',username,' . $id . ',id';
     $rules['doc'] .= ',doc,' . $id . ',id';
     $rules['email'] .= ',email,' . $id . ',id';
     $rules['password'] = 'confirmed';
     $rules['terms'] = '';
     return $rules;
 }
开发者ID:NuestraMarca,项目名称:tenderos,代码行数:19,代码来源:EditRequest.php

示例5: find

 public function find(Route $route)
 {
     $manuales = manuales::find($route->getParameter('manuales'));
     if (!$manuales) {
         abort(404);
     }
 }
开发者ID:veronico12,项目名称:aplicacion,代码行数:7,代码来源:ManualesControlador.php

示例6: findChecklist

 /**
  * Find the Checklist or App Abort 404.
  */
 public function findChecklist(Route $route)
 {
     $this->checklist = Checklist::findOrFail($route->getParameter('doit'));
     $this->checklist->load('answers.question');
     $this->checklist->answers = $this->checklist->answers->sortBy(function ($answer, $key) {
         return $answer->question->order;
     });
 }
开发者ID:andrestntx,项目名称:Education,代码行数:11,代码来源:ChecklistsController.php

示例7: findObservationFormatUser

 /**
  * Find the ObservationFormatUser or App Abort 404.
  */
 public function findObservationFormatUser(Route $route)
 {
     $this->observation = ObservationFormatUser::findOrFail($route->getParameter('doit'));
     $this->observation->load('answers.question');
     $this->observation->answers = $this->observation->answers->sortBy(function ($answer, $key) {
         return $answer->question->order;
     });
 }
开发者ID:andrestntx,项目名称:Education,代码行数:11,代码来源:ObservationsController.php

示例8: findWithTrashed

 public function findWithTrashed(Route $route)
 {
     $id = $route->getParameter('id');
     $this->resource = $this->repository->findWithTrashed($id);
     if (!$this->resource) {
         if (Request::ajax()) {
             return response()->json([], 404);
         }
         throw new NotFoundHttpException();
     }
 }
开发者ID:wachap,项目名称:imagic-api,代码行数:11,代码来源:Controller.php

示例9: detectLocale

 /**
  * @param Route $route
  */
 public function detectLocale(Route $route)
 {
     $locale = $route->getParameter('locale');
     if (sizeof(Lang::where('iso', $locale)->get()) != 0) {
         app()->setLocale($locale);
         Carbon::setLocale($locale);
     } else {
         app()->setLocale('pt');
         Carbon::setLocale('pt');
     }
     $route->forgetParameter('locale');
 }
开发者ID:jonioliveira,项目名称:prototype2015,代码行数:15,代码来源:Locale.php

示例10: showCollection

 public function showCollection(Route $route, Router $router)
 {
     // We extract the params not set in the query from the URL
     $queryParams = $route->parameters();
     // Figure out the page from the route URL parameters
     $page = max(1, $route->getParameter('page'));
     $routeParams = $route->getAction();
     $query = $routeParams['query'];
     $articles = PressFacade::query($query, $queryParams);
     if (0 === $articles->count() && $page !== 1) {
         return abort(404);
     }
     // create a paginator if required
     if ($routeParams['paginate']) {
         $page_size = PressFacade::getConf('default_page_size');
         $paginator = $articles->getPaginator($page_size);
         $articles = $articles->forPage($page, $page_size);
     } else {
         $paginator = $articles->getPaginator(999999);
     }
     // decide the view. If it is provided with the query options, just use
     // it. if it is provided with a theme wildcard, use the default theme
     // else try to find a 'collection' view in the default theme.
     // Also, the user can set a theme to load the assets from.
     $theme = array_get($routeParams, 'theme', PressFacade::getConf('theme'));
     if (isset($routeParams['view'])) {
         $viewName = str_replace('_::', "{$theme}::", $routeParams['view']);
         $view = View::make($viewName);
     } else {
         $view = View::make("{$theme}::collection");
     }
     // paginator base path
     $baseUrlParamNames = $this->getRouteParamNames($routeParams['base_route'], $router);
     $baseUrlParams = array_only($queryParams, $baseUrlParamNames);
     $basePath = \URL::route($routeParams['base_route'], $baseUrlParams);
     $paginator->setBasePath($basePath);
     // metadata from the page can be defined trough the route
     $meta = (object) array_get($routeParams, 'meta', []);
     return $view->with('meta', SEO::getMeta())->with('articles', $articles)->with('cacheInfo', PressFacade::editingCacheInfo())->with('themeAssets', PressFacade::getThemeAssets($theme))->with('paginator', $paginator);
 }
开发者ID:lud,项目名称:press,代码行数:40,代码来源:PressPubController.php

示例11: find

 public function find(Route $route)
 {
     $this->blog = Blog::find($route->getParameter('blog'));
 }
开发者ID:CanKer,项目名称:LFG_,代码行数:4,代码来源:BlogController.php

示例12: findProtocol

 /**
  * Find the Protocol or App Abort 404.
  */
 public function findProtocol(Route $route)
 {
     $this->protocol = Protocol::findOrFail($route->getParameter('protocols'));
 }
开发者ID:andrestntx,项目名称:Education,代码行数:7,代码来源:ExamsController.php

示例13: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     return ['name' => 'required', 'username' => 'required', 'email' => 'required|unique:users,email,' . $this->route->getParameter('users'), 'password' => '', 'type' => 'required|in:user,admin,editor,visit'];
 }
开发者ID:herberk,项目名称:herberk,代码行数:9,代码来源:EditUserRequest.php

示例14: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     return ['identification' => 'required|unique:users,identification,' . $this->route->getParameter('users'), 'first_name' => 'required', 'last_name' => 'required', 'type' => 'required', 'email' => 'required|unique:users,email,' . $this->route->getParameter('users'), 'password' => 'required'];
 }
开发者ID:jrafaelca,项目名称:infrea,代码行数:9,代码来源:EditUserRequest.php

示例15: getSlug

 /**
  * Get the slug of the trick being edited / deleted.
  *
  * @param \Illuminate\Routing\Route $route
  *
  * @return string
  */
 protected function getSlug($route)
 {
     return $route->getParameter('trick_slug');
 }
开发者ID:qloog,项目名称:site,代码行数:11,代码来源:TrickOwner.php


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