On 8/21/09 4:06 PM, Aryeh Gregor wrote:
What are other people's thoughts on what a nice
interface would look
like here? (Other than "PHP should have named parameters like
Python"? :) ) Xml is very inconsistent on this score, and it would
be nice if we had a consistent format for Html.
Most of the Xml:: wrappers are about as consistent as I think you can
reasonably get without giving everything the same form as not having
defaults, overall. :)
The Xml:: and Html:: functions are fairly low-level; we've also now got
the HtmlForm class, which Andrew built for the Special:Preferences rewrite.
This gives you a way to build a form descriptively, including specifying
input validation and giving a clean way for extensions to add things to
your form...
My inclination is that most UI code should be using HtmlForm or
something like it to define its form structure, and not be building
forms from scratch (whether out of raw HTML strings or building them
element-by-element with helper functions).
-- brion