Reputation: 14470
I want a library to generate standards compliant HTML form.
Some expected features:
Upvotes: 1
Views: 521
Reputation: 22817
If forms are a recurring element of your application, you should choose kind of a library to keep them consistent for sure, being it either yours or third party, over vanilla HTML code [which you'll be generating as output as well, of course].
You can use the form component from Symfony [guide here], which will imply using the Request component as well because you'll want to bind the request itself to the form, validate the input, and so.
Upvotes: 1
Reputation: 6884
The Zend framework has fairly advanced forms support, which can be used standalone (i.e. without having to the Zend MVC framework).
Jonahlyn Gilstrap has done a great write up of how to do this: http://jonahlyn.heroku.com/blog/2011/04/06/using-zend-form-without-the-framework
It's certainly a good idea if you are planning to do several forms, but using a framework for them may be overkill if you only need one or two forms (if only because it may in practice limit how you can lay out and style them).
Upvotes: 1
Reputation: 2693
In frameworks you often have an engine that can do this for you. For example in cakephp you can use functions from the FormHelper class as so:
echo $this->Form->create();
echo $this->Form->input('User.name');
echo $this->Form->end();
There is no such thing as a "The Form library" but you can imagine it's not that difficult to create a nice class for yourself which can handle a lot of your html generation.
Upvotes: 0