views:

29

answers:

1

I am mulling over whether I should place metadata in an XML file, then creating an object that automates validation. The reasoning behind this is, adding or removing validation for user input would be a matter updating an XML file.

I was curious what the opinions of others were on the usefulness of automating field validation in PHP.

It seems these days, I'm having a tough time writing code without get consensus of other programmers. :-|

A: 

It really depends on what's standard in your particular application and/or framework. I'd personally stay away from doing something like that because most validations are fairly specific to the task at hand, and putting something like that in an xml file is really a mis-use of the format.

Automatic field validation itself is, of course, highly useful, and one of the features of great convenience in frameworks like Django.

Paul McMillan
The plan is to save the initial field metadata in an XML file, cache the result and then use include on subsequent request.Using an xml file to set up things initially is a lot easier.
Andre