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


PHP Request::old方法代碼示例

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


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

示例1: getIndex

 /**
  * Responds to requests to GET /generator/lorem_ipsum
  */
 public function getIndex(Request $request)
 {
     $lorem_ipsum = [];
     $count = $request->old('count') && $request->old('count') > 0 ? $request->old('count') : 5;
     $type = $request->old('type') ? $request->old('type') : 'paragraphs';
     return view('generators.lorem_ipsum', ['lorem_ipsum' => $lorem_ipsum, 'count' => $count, 'type' => $type]);
 }
開發者ID:kakhaUrigashvili,項目名稱:csci-e-15-p3,代碼行數:10,代碼來源:LoremIpsumController.php

示例2: create

 /**
  * Show user form.
  *
  * @return \Illuminate\View\View
  */
 public function create()
 {
     $roles = $this->getAllowedRoles();
     $selectedRoles = $this->request->old('roles');
     $user = new User(['blocked' => 0, 'confirmed' => 1]);
     return view('administrator.users.create', compact('user', 'roles', 'selectedRoles'));
 }
開發者ID:yajra,項目名稱:cms-core,代碼行數:12,代碼來源:UsersController.php

示例3: create

 /**
  * Show role form.
  *
  * @return \Illuminate\View\View
  */
 public function create()
 {
     $role = new Role();
     $permissions = Permission::all();
     $selectedPermissions = $this->request->old('permissions', []);
     return view('administrator.roles.create', compact('role', 'permissions', 'selectedPermissions'));
 }
開發者ID:yajra,項目名稱:cms-core,代碼行數:12,代碼來源:RolesController.php

示例4: getRequestAsArray

 public function getRequestAsArray($method)
 {
     if ($old = $this->request->old()) {
         return $old;
     }
     return $this->request->all();
 }
開發者ID:realholgi,項目名稱:formobject,代碼行數:7,代碼來源:InputRequestProvider.php

示例5: getLogin

 public function getLogin(Request $request)
 {
     if ($request->old('email') && $request->old('nome')) {
         return view('login.index', ['email' => $request->old('email'), 'nome' => $request->old('nome')]);
     }
     return redirect()->back();
 }
開發者ID:basalbr,項目名稱:fvm,代碼行數:7,代碼來源:AuthController.php

示例6: getIndex

 /**
  * Responds to requests to GET /generator/random_user
  */
 public function getIndex(Request $request)
 {
     $users = [];
     $count = $request->old('count') && $request->old('count') > 0 ? $request->old('count') : 5;
     $options = $request->old('options') ? $request->old('options') : [];
     //address,phone,email,etc
     return view('generators.random_user', ['count' => $count, 'users' => $users, 'options' => $options]);
 }
開發者ID:kakhaUrigashvili,項目名稱:csci-e-15-p3,代碼行數:11,代碼來源:RandomUserController.php

示例7: getRequestAsArray

 public function getRequestAsArray($method)
 {
     if ($old = $this->request->old()) {
         $data = $old;
     } else {
         $data = $this->request->all();
     }
     return $data;
 }
開發者ID:aktiWeb,項目名稱:formobject,代碼行數:9,代碼來源:InputRequestProvider.php

示例8: getOldValue

 /**
  * @param string $name
  * @return null|string
  */
 public function getOldValue($name)
 {
     $name = str_replace(['[', ']'], ['.', ''], $name);
     $current = $this->request->input($name);
     $old = $this->request->old($name);
     if (isset($current)) {
         return $current;
     }
     if (isset($old)) {
         return $old;
     }
     return null;
 }
開發者ID:laraplus,項目名稱:form,代碼行數:17,代碼來源:LaravelDataStore.php

示例9: handle

 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return string|null
  */
 public function handle(Request $request)
 {
     $key = $this->account->generateRecoveryKey();
     $registration = app('account.registration');
     $registration->account_id = $this->account->id();
     $registration->firstname = $request->old('firstname');
     $registration->surname = $request->old('surname');
     $registration->country = $request->old('country');
     $registration->gender = $request->old('gender');
     $registration->birthday = $this->birthday($request);
     $registration->save();
     event(new Created($this->account));
     return $key;
 }
開發者ID:apolune,項目名稱:account,代碼行數:20,代碼來源:Create.php

示例10: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  * @param Request $request
  * @return View
  */
 public function edit($id, Request $request)
 {
     /** @var Training $training */
     $training = Training::findOrFail($id);
     $training->fill($request->old());
     return $this->render('training/edit', ['training' => $training]);
 }
開發者ID:gitter-badger,項目名稱:acadevel,代碼行數:14,代碼來源:TrainingController.php

示例11: create

 /**
  * The create form.
  * @param \Illuminate\Http\Request $request
  * @return Response
  */
 public function create(Request $request)
 {
     $options = $request->old('option');
     if (!is_array($options)) {
         $options = [1 => '', 2 => '', 3 => ''];
     }
     return View::make('polls.create')->with('options', $options);
 }
開發者ID:backstagetechnicalservices,項目名稱:website,代碼行數:13,代碼來源:PollsController.php

示例12: handle

 /**
  * Handle the event.
  */
 public function handle(Request $request)
 {
     /* @var FieldType $field */
     foreach ($request->old() as $key => $value) {
         if ($field = $this->builder->getFormField($key)) {
             $field->setValue($value);
         }
     }
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:12,代碼來源:PopulateFields.php

示例13: edit

 public function edit(Request $r, $id)
 {
     $user = User::findOrFail($id);
     $errors = [];
     if ($r->session()->has('errors')) {
         $errors = $r->session()->get('errors')->all();
     }
     return view('admin.users.edit')->with('user', $user->fill($r->old()))->with('errors', $errors)->with('method', 'put');
 }
開發者ID:sguillen-proyectos,項目名稱:laravel_training,代碼行數:9,代碼來源:UserController.php

示例14: create

 public function create(Request $request)
 {
     if (Gate::denies('pembelian.create')) {
         return view(config('app.template') . '.error.403');
     }
     if (!$request->old()) {
         $request->session()->forget('data_pembelian');
     }
     return view(config('app.template') . '.pembelian.create');
 }
開發者ID:sopoisun,項目名稱:narotser-hadni-kodnop,代碼行數:10,代碼來源:PembelianController.php

示例15: create

 public function create(Request $request)
 {
     if (Gate::denies('adjustment.create')) {
         return view(config('app.template') . '.error.403');
     }
     if (!$request->old()) {
         $request->session()->forget('data_adjustment');
     }
     $data = ['types' => Adjustment::$types, 'states' => Adjustment::$states];
     return view(config('app.template') . '.adjustment.create', $data);
 }
開發者ID:sopoisun,項目名稱:narotser-hadni-kodnop,代碼行數:11,代碼來源:AdjustmentController.php


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