In reality it is not a question but rather if you can give me some direction to take on a subject.
I took a project to fix and the developer used CodeIgniter, but the project is quite large and we have several files.
The big problem is that for each Product, Category, User, etc. the developer created a view to edit the data (edit_user.php) and a page to insert a new user (new_user.php), what is the difference between two: The only difference is that in the first view the INPUT fields have the value ( $user[0]->txtNome
and in the second view the value fields are blank
The problem with this is that if I change or insert a field for the user, I have to change both pages, too much work.
One solution would be to put an IF on all inputs, but this could get huge, depending on the amount of form fields.
Another output would be to create an objet with the name of all fields and assign the value equal to NULL, which would look great too.
The question is:
- Is there any way in CodeIgniter to create this dynamically, ie using a set_fields, creating an empty object, etc.
I would not like to use Dynamic CRUD like GROCERY, so if anyone has any suggestions or a direction they could give me, I appreciate everyone's help