-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: username input form shows root as a default value #4062
Comments
If I understand correctly, you are saying that |
Yes, it is. I post code snippets below: Controller:
Model:
View:
|
You are using a Model where you want a result or Entity. Your model connects to the database and retrieves the rows. It also has magic get function to cascade into its database connection, so when you ask for "UserModel->password" it is actually retrieving your database connection password, just like you asked. Check the User Guide section on using Models. |
Describe the bug
By default, it displays the user and password values from the Database.php database configuration file in the user input and password fields of any custom view.
CodeIgniter 4 version
4.0.4
Expected behavior, and steps to reproduce if appropriate
View code:
<input class="form-control" type="text" name="username" id="username" value="<?= $data->username ?>" />
The input field show root when the data is empty, because the username of my database config is root!
Context
The text was updated successfully, but these errors were encountered: