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


PHP Input::old方法代码示例

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


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

示例1: getCreate

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getCreate()
 {
     $permissions = $this->permission->all();
     $selectedPermissions = Input::old('permissions', array());
     $title = Lang::get('admin/roles/title.create_a_new_role');
     return View::make('admin/roles/create', compact('permissions', 'selectedPermissions', 'title'));
 }
开发者ID:ntk148v,项目名称:mini_cms,代码行数:12,代码来源:AdminRolesController.php

示例2: update

 public function update($view, $account)
 {
     $view->form(function ($view) use($account) {
         $view->page_header(function ($view) {
             $view->title('EDIT ACCOUNT');
         });
         // The response body is the Account
         $account = $account->get();
         // Get Roles and put it in a nice array for the dropdown
         $roles = array('' => '') + model_array_pluck(API::get(array('roles'))->get('results'), function ($role) {
             return $role->lang->name;
         }, 'id');
         // Get the Roles that belong to a User and put it in a nice array for the dropdown
         $active_roles = array();
         if (isset($account->roles)) {
             $active_roles = model_array_pluck($account->roles, 'id', '');
         }
         // Get Languages and put it in a nice array for the dropdown
         $languages = model_array_pluck(API::get(array('languages'))->get('results'), function ($language) {
             return $language->name;
         }, 'id');
         $view->text('name', __('admin::account.update.form.name'), Input::old('name', $account->name));
         $view->text('email', __('admin::account.update.form.email'), Input::old('email', $account->email));
         $view->password('password', __('admin::account.update.form.password'));
         $view->multiple('roles[]', __('admin::account.update.form.roles'), $roles, Input::old('roles', $active_roles));
         $view->dropdown('language_id', __('admin::account.update.form.language'), $languages, Input::old('language_id', $account->language->id));
         $view->actions(function ($view) {
             $view->submit(__('admin::account.update.buttons.edit'), 'primary');
         });
     }, 'PUT', prefix('admin') . 'account/' . $account->get('id') . '/edit');
 }
开发者ID:reith2004,项目名称:admin,代码行数:31,代码来源:account.php

示例3: resetAction

 public function resetAction()
 {
     $token = "?token=" . Input::get("token");
     $errors = new MessageBag();
     if ($old = Input::old("errors")) {
         $errors = $old;
     }
     $data = ["token" => $token, "errors" => $errors];
     if (Input::server("REQUEST_METHOD") == "POST") {
         $validator = Validator::make(Input::all(), ["email" => "required|email", "password" => "required|min:6", "password_confirmation" => "required|same:password", "token" => "required|exists:token,token"]);
         if ($validator->passes()) {
             $credentials = ["email" => Input::get("email")];
             Password::reset($credentials, function ($user, $password) {
                 $user->password = Hash::make($password);
                 $user->save();
                 Auth::login($user);
                 return Redirect::route("user/profile");
             });
         }
         $data["email"] = Input::get("email");
         $data["errors"] = $validator->errors();
         return Redirect::to(URL::route("user/reset") . $token)->withInput($data);
     }
     return View::make("user/reset", $data);
 }
开发者ID:alejandromorg,项目名称:Inventario,代码行数:25,代码来源:UserController.php

示例4: update

 public static function update($view, $id)
 {
     // Get the Account
     $response = API::get(array('account', $id));
     // Handle response codes other than 200 OK
     if (!$response->success) {
         return Event::first($response->code);
     }
     // The response body is the Account
     $account = $response->get();
     // Get Roles and put it in a nice array for the dropdown
     $roles = array('' => '') + model_array_pluck(API::get(array('role', 'all'))->get('results'), function ($role) {
         return $role->lang->name;
     }, 'id');
     // Get the Roles that belong to a User and put it in a nice array for the dropdown
     $active_roles = array();
     if (isset($account->roles)) {
         $active_roles = model_array_pluck($account->roles, 'id', '');
     }
     // Get Languages and put it in a nice array for the dropdown
     $languages = model_array_pluck(API::get(array('language', 'all'))->get('results'), function ($language) {
         return $language->name;
     }, 'id');
     $view->text('name', __('admin::account.update.form.name'), Input::old('name', $account->name));
     $view->text('email', __('admin::account.update.form.email'), Input::old('email', $account->email));
     $view->password('password', __('admin::account.update.form.password'));
     $view->multiple('roles[]', __('admin::account.update.form.roles'), $roles, Input::old('roles', $active_roles));
     $view->dropdown('language_id', __('admin::account.update.form.language'), $languages, Input::old('language_id', $account->language->id));
     $view->actions(function ($view) {
         $view->submit(__('admin::account.update.buttons.edit'), 'primary');
     });
 }
开发者ID:reith2004,项目名称:admin,代码行数:32,代码来源:module.php

示例5: inputOld

 public static function inputOld($string)
 {
     if (static::isLaravel()) {
         return \Input::old($string);
     }
     return false;
 }
开发者ID:neondigital,项目名称:forma,代码行数:7,代码来源:Helpers.php

示例6: getGenerateLicense

 /**
  * Show generate license form
  */
 public function getGenerateLicense()
 {
     $this->_data['page_title'] = "Generate License";
     $this->_data['affiliates'] = Affiliate::orderBy('name', 'ASC')->get();
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     $this->_data['plans'] = Plan::orderBy('name', 'ASC')->where('product_id', '=', Input::old('product_id'))->get();
     return View::make('admin.utilities.generate-license', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:11,代码来源:UtilitiesController.php

示例7: __construct

 public function __construct()
 {
     $errors = new MessageBag();
     if ($old = Input::old("errors")) {
         $errors = $old;
     }
     $this->errors = $errors;
 }
开发者ID:alejandromorg,项目名称:Inventario,代码行数:8,代码来源:BaseForm.php

示例8: form_old

function form_old($name, $default = null)
{
    if (Input::old($name) != null) {
        echo Input::old($name);
    } else {
        echo $default;
    }
}
开发者ID:b0yblake1,项目名称:duan,代码行数:8,代码来源:helpers.php

示例9: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $promo = $this->promo;
     if (Input::old('img') != '') {
         $promo->img = Input::old('img');
     }
     return View::make('backend.promos.edit', compact('promo'));
 }
开发者ID:alex-petkevich,项目名称:proweb5,代码行数:13,代码来源:PromosController.php

示例10: getCreate

 /**
  * Group create.
  *
  * @return View
  */
 public function getCreate()
 {
     // Get all the available permissions
     $permissions = $this->permissions;
     // Selected permissions
     $selectedPermissions = Input::old('permissions', array());
     // Show the page
     return View::make('admin/groups/create', compact('permissions', 'selectedPermissions'));
 }
开发者ID:nozkok,项目名称:laravel-4-starter,代码行数:14,代码来源:AdminGroupsController.php

示例11: findOrCreate

/**
 * @param $model
 * @param $id
 * @return mixed
 */
function findOrCreate($model, $id)
{
    $obj = $model::find($id);
    $obj = $obj ?: new $model();
    foreach (Input::old() as $key => $old) {
        $obj->{$key} = $old ?: $obj->{$key};
    }
    return $obj;
}
开发者ID:birdiebel,项目名称:G2016,代码行数:14,代码来源:myArdent.php

示例12: testOldInputCanBeRetrievedFromSession

 /**
  * Test the Input::old method.
  *
  * @group laravel
  */
 public function testOldInputCanBeRetrievedFromSession()
 {
     $this->setSession();
     Session::$instance->session['data']['laravel_old_input'] = array('name' => 'Taylor');
     $this->assertNull(Input::old('foo'));
     $this->assertTrue(Input::had('name'));
     $this->assertFalse(Input::had('foo'));
     $this->assertEquals('Taylor', Input::old('name'));
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:14,代码来源:input.test.php

示例13: getVolunteerMentors

 public function getVolunteerMentors()
 {
     $city = \Input::old('volunteerMentorCity');
     if ($city === null) {
         $cities = $this->getVolunteerMentorCities();
         $city = $cities ? reset($cities) : null;
     }
     return $city ? VolunteerMentorQuery::create()->getVolunteerMentorByCity($city) : [];
 }
开发者ID:Junyue,项目名称:zidisha2,代码行数:9,代码来源:ProfileForm.php

示例14: getCreate

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getCreate()
 {
     $roles = $this->role->all();
     $permissions = $this->permission->all();
     $selectedRoles = Input::old('roles', array());
     $selectedPermissions = Input::old('permissions', array());
     $mode = 'create';
     $title = Lang::get('admin/users/title.create_a_new_user');
     return Theme::make('admin/users/create_edit', compact('roles', 'permissions', 'selectedRoles', 'selectedPermissions', 'title', 'mode'));
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:15,代码来源:AdminUsersController.php

示例15: edit

 public function edit($role)
 {
     if (in_array(Input::old('name', $role->name), \Role::$protected) && Input::old('name', $role->name) != Input::get('name') || in_array(Input::get('name'), \Role::$protected) && Input::old('name', $role->name) != Input::get('name')) {
         return Api::to(array('error', Lang::get('admin/roles/messages.update.error'))) ?: Redirect::to('admin/roles/' . $role->id . '/edit')->with('error', Lang::get('admin/roles/messages.update.error'));
     }
     $inputs = Input::except('csrf_token');
     $save = $this->role->createOrUpdate($role->id, $this->permission->preparePermissionsForSave($inputs['permissions']));
     $errors = $save->errors();
     return count($errors->all()) == 0 ? Api::to(array('success', Lang::get('admin/roles/messages.update.success'))) ?: Redirect::to('admin/roles/' . $role->id . '/edit')->with('success', Lang::get('admin/roles/messages.update.success')) : (Api::to(array('error', Lang::get('admin/roles/messages.update.error'))) ?: Redirect::to('admin/roles/' . $role->id . '/edit')->withErrors($errors));
 }
开发者ID:Askedio,项目名称:LaravelCP-v1,代码行数:10,代码来源:RoleService.php


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