[drupal-devel] RFC: Forms API Reference Draft
Hopefully it is OK to cross-post between these two groups. :\ This is about documentation, but it's written for developers and I really need their input. I have created a forms API progammer's reference which is available in my sandbox: http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/sandbox/webchi... This contains 3 things: 1. A table of all elements and properties, which shows which can be used in each. 2. An elements reference containing all of the possible 'types' that form elements can be set to, along with their allowed attributes. 3. A properties reference containing a list of all the properties that I could find from grepping the source, along with their descriptions and to which form elements they belong. Each element/property is accompanied by a usage example to illustrate how it is used (randomly selected from various core modules), and I've also cross-referenced between elements and properties so you can quickly jump around to the information you need. "Required" elements properties are in bold on each form element (some not strictly required, but there would have to be a good reason to avoid them). If you guys could have a look and throw me your 2 cents on this document overall that would be awesome. Stuff in green is stuff that "should" be done and complete. Things marked in yellow are things I wasn't sure about. If you can shed light here, tell me where I've missed things, or say, "Yep, that's right" then I would really appreciate it. Once it is in a more completed state, I will move it to contributions/docs/developer/topics so it will be listed in drupaldocs.org. -Angie
On 18/10/05, Angie Byron <drupal-devel@webchick.net> wrote:
If you guys could have a look and throw me your 2 cents on this document overall that would be awesome.
Should the same document cover a few fundamentals first? For example, after reading it, I still have no idea how to create a simple form and do anything with it. Some example things I still don't know for certain: * Do I create the $form array myself, or is there something which initialises it for me? * How important is the array key "preview", and what does it relate to? * " $fields[$category][$field->name]" - it is not clear where this fits in with everything else (or any other nested part of a $form) * How do I put controls into a block? * Can I put controls into a table? I know I could answer all these questions myself by looking at examples, I'm just curious if they should be part of the same documentation. -- David Carrington
I think not. It's going to be on drupaldocs.org, so I'm sure the fundamentals will be in an accompanying document. http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/docs/developer... Angie, as it stands it's pretty much what I've been waiting for someone else to put together. :-) Thanks. On 10/18/05, David Carrington <david.carrington@gmail.com> wrote:
Should the same document cover a few fundamentals first? For example, after reading it, I still have no idea how to create a simple form and do anything with it.
David Carrington wrote:
Should the same document cover a few fundamentals first? For example, after reading it, I still have no idea how to create a simple form and do anything with it.
Oops! My apologies. That documentation is already in the progress of being written, and is already up @ drupaldocs.org. To eliminate confusion, I've linked to it from the top of mine. Thanks!! -Angie
On 10/18/05, Angie Byron <drupal-devel@webchick.net> wrote:
Hopefully it is OK to cross-post between these two groups. :\ This is about documentation, but it's written for developers and I really need their input.
I have created a forms API progammer's reference which is available in my sandbox:
This is really great stuff. Combined with the quickstart guide I was able to convert 2 of my modules today to make use of the new forms API. The catch is that they were modules that used the _settings(), or_nodeapi() or user() hook, which makes things a bit easier, since you don't have the concerns of executing the form :). There still needs to be a bit of documentation on how the _nodeapi('form') and the user('form') hooks were changed in regards to the return values, because that was the hardest part I did today. /rambling Grtz, Breyten :-)
participants (4)
-
Angie Byron -
Breyten Ernsting -
David Carrington -
Earl Dunovant