Comments: on this page. Click to read or post your own.
Base class for all forms.
The form class is an extensible base for all forms on a sapphire application. It can be used either by extending it, and creating processor methods on the subclass, or by creating instances of form whose actions are handled by the parent controller.
In either case, if you want to get a form to do anything, it must be inextricably tied to a controller. The constructor is passed a controller and a method on that controller. This method should return the form object, and it shouldn't require any arguments. Parameters, if necessary, can be passed using the URL or get variables. These restrictions are in place so that we can recreate the form object upon form submission, without the use of a session, which would be too resource-intensive.
You will need to create at least one method for processing the submission (through FormAction). This method will be passed two parameters: the raw request data, and the form object. Usually you want to save data into a DataObject by using saveInto(). If you want to process the submitted data in any way, please use getData() rather than the raw request data.
| Class | Description |
|---|---|
| Form | Base class for all forms. |
| Form_FieldMap | Base object that all others should inherit from. |
Documentation generated on Sun, 19 Oct 2008 06:41:06 +1300 by phpDocumentor 1.3.2