views:

50

answers:

2

Hi everybody,

When looking back at last weeks work (identical to many others), I've found myself spending the major part of my time putting together forms of which POST-data are used to perform database CRUD operations through my MVC-models.

When reflecting over this, it becomes a bit worrying. It's not really appropriate to spend the amount of time I am spending on doing the most basic part in the applications design.

What would be an appropriate way to reduce this time and effectivizing the creation and handling of forms?

Thanks

A: 

Use a framework such as CakePHP, it will do all this basic things for you.

levu
Hi! Already use Codeigniter with validation + form helpers when is possible.
Industrial
+1  A: 

Why is making forms and doing crud operations with POST data not appropriate for you?

A web application is all about interacting with a database, using a user interface. Any attempt to spend less time on creating forms by using tools or frameworks, will have side-effects. In my opinion, you want your forms designed elegantly, because your users will interact with them, maybe very frequently. Every form should be designed to be as simple and straight-forward as possible.

You could benefit from the support of a user interface/user interaction designer. Explain to this person what the purpose of the form is, and what the data represents that is being submitted. You could also provide field names and validation rules per field name. The job of the interaction designer is to provide you with the HTML for the form, which you can plug into your existing framework. Let the interaction designer also build the client side validation code using a good JQuery plugin.

Your job is now reduced to receiving the POST array, maybe perfom some extra server-side validation and form-value sanitizing, and writing the data to the database, preferrably using model functions.

I strongly advise against using form generators or scaffolding.

Symen Timmermans