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