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