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


PHP Router::input方法代碼示例

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


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

示例1: input

 /**
  * Get a route parameter for the current route.
  *
  * @param string $key
  * @param string $default
  * @return mixed 
  * @static 
  */
 public static function input($key, $default = null)
 {
     return \Illuminate\Routing\Router::input($key, $default);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:12,代碼來源:_ide_helper.php

示例2: boot

 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  *
  * @return void
  */
 public function boot(Router $router)
 {
     $router->bind('adWithTrashed', function ($id) {
         return Ad::with('content')->withTrashed()->findOrFail($id);
     });
     $router->bind('ad', function ($id) {
         return Ad::with('content')->findOrFail($id);
     });
     $router->bind('adCollection', function ($ids) {
         $ids = explode(',', $ids);
         return Ad::with('content')->withTrashed()->findMany($ids);
     });
     $router->bind('adstatus', function ($title) {
         return Adstatus::whereTitle($title)->firstOrFail();
     });
     $router->bind('adValidated', function ($id) {
         return Ad::with('content')->validate()->findOrFail($id);
     });
     $router->bind('adPreview', function ($id) {
         if (Auth::guard('admin')->check()) {
             return Ad::with('content')->withTrashed()->findOrFail($id);
         }
         if (Auth::guard('user')->check()) {
             return Auth::user()->ads()->with('content')->findOrFail($id);
         }
         abort(404);
     });
     $router->bind('adtypeNotCustomized', function ($id) {
         return Adtype::whereIsCustomized(0)->findOrFail($id);
     });
     $router->bind('adtypeCollection', function ($ids) {
         $ids = explode(',', $ids);
         return Adtype::findMany($ids);
     });
     $router->bind('templateCollection', function ($ids) {
         $ids = explode(',', $ids);
         return Template::findMany($ids);
     });
     $router->bind('encryptedOrderId', function ($enc) {
         $orderId = Crypt::decrypt($enc);
         return Order::findOrFail($orderId);
     });
     $router->bind('fieldCollection', function ($ids) {
         $ids = explode(',', $ids);
         return Field::findMany($ids);
     });
     $router->bind('subscriptionCollection', function ($ids) {
         $ids = explode(',', $ids);
         return Subscription::findMany($ids);
     });
     $router->bind('userCollection', function ($ids) {
         $ids = explode(',', $ids);
         return User::findMany($ids);
     });
     $router->bind('adUser', function ($id) {
         if (Auth::check()) {
             return Auth::user()->ads()->with('content')->findOrFail($id);
         } else {
             abort(404);
         }
     });
     $router->bind('field', function ($id) {
         return Field::with('search')->findOrFail($id);
     });
     $router->bind('visibleCategory', function ($id) {
         return Category::visible()->findOrFail($id);
     });
     $router->bind('templateblock', function ($identifier) use($router) {
         $page = $router->input('page');
         return Templateblock::whereIdentifier($identifier)->whereTemplateId($page->template->id)->firstOrFail();
     });
     $router->bind('widgetnode', function ($id) use($router) {
         $pageId = $router->input('page')->id;
         $templateblockId = $router->input('templateblock')->id;
         return Widgetnode::whereTemplateblockId($templateblockId)->wherePageId($pageId)->findOrFail($id);
     });
     $router->model('adtype', 'ZEDx\\Models\\Adtype');
     $router->model('template', 'ZEDx\\Models\\Template');
     $router->model('category', 'ZEDx\\Models\\Category');
     $router->model('country', 'ZEDx\\Models\\Country');
     $router->model('page', 'ZEDx\\Models\\Page');
     $router->model('menu', 'ZEDx\\Models\\Menu');
     $router->model('gateway', 'ZEDx\\Models\\Gateway');
     $router->model('themepartial', 'ZEDx\\Models\\Themepartial');
     $router->model('dashboardWidget', 'ZEDx\\Models\\Dashboardwidget');
     $router->model('searchfield', 'ZEDx\\Models\\SearchField');
     $router->model('selectfield', 'ZEDx\\Models\\SelectField');
     $router->model('subscription', 'ZEDx\\Models\\Subscription');
     $router->model('user', 'ZEDx\\Models\\User');
     parent::boot($router);
 }
開發者ID:zedx,項目名稱:core,代碼行數:98,代碼來源:RouteServiceProvider.php

示例3: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules(Router $router)
 {
     $member = $router->input('member');
     $unique = sprintf('unique:%s,%s,%s,%s', $member->getTable(), 'display_name', $member->getKey(), $member->getKeyName());
     return ['display_name' => 'required|min:1|max:12|' . $unique, 'member_rank' => 'required'];
 }
開發者ID:grit45,項目名稱:Clan,代碼行數:11,代碼來源:Update.php

示例4: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules(Router $router)
 {
     $id = $router->input('id');
     $rules = ['email' => 'required|email|unique:users,email,' . $id, 'first_name' => 'required', 'last_name' => 'required', 'contact_numbers' => 'required', 'role_id' => 'required'];
     return $rules;
 }
開發者ID:damnyan,項目名稱:laravel,代碼行數:11,代碼來源:UpdateAdministratorRequest.php


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