I don't agree with this plan. Once again, I think we need to isolate the core features from UI options. A standard form API is not necessary, and would simply introduce additional user training issues and core bloat.
It seems we are often at odds, Jason.
I fail to see how having a consistent way to produce forms in the system introduces bloat OR user training issues-- especially since the users would never see it.
At the moment there is no consistency in input. The forms on one page may not work like any other form, especially once snippets/modules/whatever can accept input in the backend (like they can already do).
There is an enormous difference between an enduser API and an internal API that the program uses to cut down on code redudancy and ensure consistency. The ONLY thing that I'm interested in is the core API used internally.
As such, I fail to see why having a consistent means for programmers to build the forms is bad. Can you imagine if the operating systems didn't have a standard API for building widgets and elements and just let developers do whatever? I, for one, wouldn't even bother turning a computer on. There has to be some standards and consistency somewhere.
Anyway, please explain what I'm failing to see here. Please?
I'm trying to get to the same end result you are, but instead of isolating developer and end-user API's, I'm attempting to abstract them down to a resuable state. In other words, whatever API's the core has available should be inclusive of all types of object management, including getting/setting properties, executing class functions on the instances, even evaluating events/rules, display formatters, or defining relationships. In this way, your form API becomes just another set of class variables, and functions, extended from the core which define the extended capabilities I'm talking about. Instead of a dedicated API function, you use a core API to get/set/execute/evaluate expressions/etc., in a standard, user-friendly way, on the various object definitions.
So, instead if something like this...
$modx->buildForm(param1, param2, etc.)
you might use something like this...
$modx->set(subject, predicate)
OR
$modx->set($form->action, $controller->getRequestParam('action'))
where subject is the target object attribute to set a value for, and predicate is the expression to evaluate. This is a bad example and perhaps we could work together to see how this can be used to build just about any kind of web application you can imagine; I just hope I'm able to illustrate what I'm trying to talk about in such abstract terms.
I really not pulling this out of my a$%; I've worked with a J2EE framework based on similar concepts, where we used this type of code to build custom JSP tag libraries for the designers -- in our case, we'd just need to work out very simple syntax for representing the objects/expressions site designers/admins would often be using directly in the templates, or defining on a wizard/form in the manager.