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