PHP forms from various frameworks - Strengths/Weaknesses?
Looking around, there are plenty of options available for form management in PHP from several frameworks: Zend, CakePHP, CodeIgniter, Symfony, and probably se开发者_运维知识库veral others offer solutions. All else being equal, which set of form classes do you prefer? What makes any of these better than the others?
Difficult question and it is inter-framework. ( I am using zend so I can only share the zend_form )
- Strengths
- Validation
- Filters
- Easy to create custom validations and filters
- i18n support - currencies, datetime etc.
- simple layouting ( echo $this->form() )
*weakness ( for me )
- Decorators - Steep learning curve
- Advance design and layouting
Looking at how different frameworks implement forms it's overly complex and it does not do full cycle. Such as adding same form twice on the page would mess up ability to see which one was submitted.
The framework I am maintainer of - Agile Toolkit chooses to do simple yet full-circle approach. That is - it will provide validators, filters, layouts, but it also provides client-side jQuery UI widget, ajax submit and submission handling.
I have wrote a blog about this: http://agiletoolkit.org/blog/forms/
Form documentation in Agile Toolkit: http://agiletoolkit.org/doc/form
When Forms were designed in Agile Toolkit the goal was to make them self-sufficient and never make developers think about again. Used it for 5 years and it's working, never had any limitation in any 3rd party projects which we couldn't get by.
What do you think?
精彩评论