Form.class.php File Reference

Go to the source code of this file.

Classes

class  spunQ_Form
 The top-most FieldContainer. More...


Detailed Description

Developer log entry:
Necdet Can Atesman (2009-10-21): A rewrite of this module is due already, let's analyze a bit on that occasion.
What do we need to separate in forms if we want to have the structure of a form completely isolated from its appearance or the data to display.
form file:
  • name
  • fields
    • name
    • validators
template using the form:
  • data to display
  • page to link to (target)
  • buttons + button labels.
How do we access the form in the templates. It should be as simple as possible. Ideally it should use a template. Templates don't work with normal classes; the form class would need to extend spunQ_DataObject - that would be possible, though.
Developer log entry:
Necdet Can Atesman (2010-09-27): The forms are undergoing another rewrite. All previous ideas had been implemented, but several new features had tainted the layout presented above. The next implementation shall not contain any presentational data within the form definition. I guess the primary problem was the wrong motivation for the show() function, which tried to provide a presentation of the form that could be left intact in a productive environment (i.e. in a finished project.) This erroneous assumption has been eliminated this time: that function is mereley there for providing a minimalistic html presentation of the form for PHP-developers this time, which means that forms don't need any presentational data now.
Here are the key ideas for this new version that were gathered during the design meeting:
  • Field::show(): Remove param $cssClasses, add a template name
  • Fields are solely defined by their I/O type (string, integer, …)
  • Form::show(): provides just a working prototype for PHP-Devs
  • form-Files go into a form-Folder
  • forms should be clone()able
  • FieldIterator / FieldGroup
  • Forms keep (and require) their name in a hidden field.
  • Validators need run-time parameters (a user, for example)
  • Validators for multiple fields (ex: password & password2)
  • Rename all *Validation classes to *Validator
  • Validators need Templates
  • Variables for Forms (just as for validators)
  • need Form::updateObject() & Form::createObject()
  • FormValidators:
    • captcha
    • honeyPot
    • notGuest
    • hash
    • accessControlValidator
  • javascript functions for:
    • copying a form
    • reindexing FieldGroupFields on submit
    • encrypting passwords in browser
    • setNewFieldGroupFieldId(fieldDom)
Developer log entry:
Necdet Can Atesman (2010-10-07): Implementation is going well, everything seems to be working out as planned. Implementation is not finished yet.
Currently missing features defined in the previous entry:
  • Validators for multiple fields (ex: password & password2)
  • need Form::updateObject() & Form::createObject()
  • FormValidators
  • javascript functions

Definition in file Form.class.php.


Generated on Fri Jul 1 11:12:37 2011 for spunQ3 by  doxygen 1.5.9