Closed sammyskills closed 1 year ago
The form helper means set_*()
helper functions.
https://codeigniter.com/user_guide/helpers/form_helper.html#set_value
See https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/form2.php
At least, you don't use form helper at all in the following code:
<input type="text" name="name" value="">
<input type="email" name="email" value="">
Good catch, @kenjis .
I think it will be nice to have this line added to the docs:
The form helper means
set_*()
helper functions
WDYT?
Okay, I sent #7678
PHP Version
7.4
CodeIgniter4 Version
4.3.6
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
No response
What happened?
From the docs about the global
old()
function, there is this statement:If I understand correctly, the statement above means that if a developer is using the form helper, for example:
form_open()
, they do not need to use theold()
function, as it is built-in.Now I have a form, and I redirected back to the previous page using
return redirect()->back()->withInput()
, but the old values of the form are not retained when I don't use<?= old() ?>
in the form value attribute.Is this a mistake or is there a specific way to do this?
Steps to Reproduce
<?= form_close() ?>