1
It’s not really a question but whether you can point me in a direction to take on a subject.
I took a project to fix and the developer used Codeigniter, but the project is quite large and with that we have several files.
The big problem is that for each Product, Category, User, etc the developer has 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 the 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 empty
The problem with this is that if I change or insert a field for the user, I have to change the two pages, lots of work.
One solution would be to put an IF in all inputs, but this could become giant, dependent 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 be great too.
The question is:
- Is there any way in Codeigniter we 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 the help of all
put an excerpt from the view code
– Wallace Maxters