I am currently working on some symfony form customisation which includes writing widgets or better still extending existing ones.
However this proves to be much more complicated as I thought it would as the functionality for validating, form elements, object saving, dynamic javascripts and so forth seem to be scattered all over the place. A lot of non default widgets that you can find are hard to extend as they often do not separate javascript not HTML.
So what should be the best practice form/widget development guidelines?
I would be willing to summarise such guidelines. Only now I am not too sure what they could look like. Lets brainstorm together!
Separate HTML from PHP Put Javascript in extra files (unobstrusiveness) Don't force your CSS styles upon others Do not write gigantic methods but small extendable/overloadable ones .. What do you think should also be included?
Original article can be found here: http://test.ical.ly/2010/08/25/question-what-would-you-expect-of-a-best-practice-document-when-developing-symfony-1-4-form-widgets/