I am currently in the process of making a fairly large website with a admin panel to control every aspect of the site. Making it is easy enough, it is just a lot of work. Because there are so many parts to the website, there are a lot of parts to the admin panel. Most of the areas of the admin panel are just a GUI for inserting data, modifying that data, and deleting that data from a database. Like the rest of the admin panel this is easy enough to do however I am finding that creating all of the HTML forms is becoming quite a tedious task. I also found that it is hard to maintain if the user wants to look of the forms changed. So then I created a function that would simply created the HTML for a single field from an array variable. The array looks like this:
$field_one = array("fieldname" => "field_one", "fieldtype" => "text", "fieldvalue" => $mysql_row['value'], "size" => "50", "maxlength" => "255", "helptext" => "Enter a value...", "fieldrequired" => false, "fieldunique" => false);
I would create an array like that for every field, and then the function would generate the HTML code needed for it. However I still found this to be quite a tedious task.
So, I am wondering if anyone else has encountered this type of problem, and if you found a better and quicker way for a project like this. Any other advice to how I could improve this code so that it is both easier to create as well as maintain would be appreciated.
Thanks!