/** * 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')); }
public function get_reset($hash64 = null) { if (is_null($hash64)) { if (Input::had('hash64')) { $hash64 = Input::old('hash64'); } else { return Response::error('404'); } } if (!($user = User::Find_Hash($hash64))) { return Response::error('404'); } return View::make('user.reset_password')->with('hash64', $hash64); }
public static function event_data($event, $field) { if (!isset($event)) { return ''; } $real_field = $field; if (stripos($field, '_') && $field !== 'event_date') { $real_field = array_get(explode('_', $field), 1); } if (Input::had($field)) { return Input::old($field); } else { if ($real_field == 'event_date') { $date = $event->{$real_field}; $lang = Config::get('application.language', 'en'); return DateFmt::Format('d#my', strtotime($date), $lang); } else { return $event->{$real_field}; } } }
<div id="image-upload"> @include('litmus::partials.message') <?php $url = isset($url) ? $url : NULL; $verb = isset($verb) ? $verb : 'POST'; echo Form::horizontal_open_for_files($url, $verb); //echo Form::token(); foreach ($fields as $field) { if (isset($field['values'])) { $form = Form::$field['type']($field['name'], $field['values']); } else { $attributes = array(); $attributes['value'] = isset($object) && isset($object->{$field['name']}) ? $object->{$field['name']} : NULL; $attributes['value'] = Input::had($field['name']) ? Input::old($field['name']) : $attributes['value']; $form = Form::$field['type']($field['name'], $attributes['value'], $attributes); } $label = Form::label($field['name'], $field['label']); echo Form::control_group($label, $form); } echo Form::actions(array(Button::primary_submit('Submit'), Form::button('Cancel'))); echo Form::close(); ?> </div>