Comments: on this page. Click to read or post your own.
Represents a field in a form.
A FieldSet contains a number of FormField objects which make up the whole of a form. In addition to single fields, FormField objects can be "composite", for example, the TabSet field. Composite fields let us define complex forms without having to resort to custom HTML.
Located in /sapphire/forms/FormField.php (line 10)
Object | --ViewableData | --RequestHandlingData | --FormField
| Class | Description |
|---|---|
| RequestHandlingTest_FormField | Form field for the test |
| ReadonlyField | Read-only field, with <label> and <span> |
| TextareaField | Multi-line text area. |
| FileField | Represents a file type which can be added to a form. |
| HiddenField | Hidden field. |
| ConfirmedPasswordField | Shows two password-fields, and checks for matching passwords. |
| CompositeField | Base class for all fields that contain other fields. |
| TreeSelectorField | |
| PhoneNumberField | Field for displaying phone numbers. It separates the number, the area code and optionally the country code and extension. |
| BankAccountField | Field for displaying bank account numbers. It separates the bank, branch, account-number and account-suffix. |
| InlineFormAction | Render a button that will act as If you want to add custom behaviour, please set {inlcudeDefaultJS} to false and work with behaviour.js. |
| InlineFormAction_ReadOnly | Readonly version of InlineFormAction. |
| DropdownField | Dropdown field, created from a <select> tag. |
| TableListField | Form field that embeds a list into a form, such as a member list or a file list. |
| DatalessField | Abstract class for all fields without data. |
| FormAction | Single action button. |
| TreeDropdownField | Dropdown-like field that gives you a tree of items, using ajax. |
| SimpleImageField_Disabled | Disabled version of SimpleImageField. |
| RelatedDataEditor | RelatedDataEditor puts a "sub-form" into a form that lets you edit a record on the other side of a one-to-many relationship. For example, you could be editing a workshop, and you want to provide fields to edit the client contact for that workshop. |
| CheckboxField | Single checkbox field. |
| ReportField | Displays complex reports based on the list of tables and fields provided to the object. |
| PasswordField | Password input field. |
| TextField | Text input field. |
| WidgetAreaEditor | Special field type for selecting and configuring widgets on a page. |
| NewsletterList | Represents a field in a form. |
| BouncedList | Represents a field in a form. |
| RecipientImportField | Displays a file upload field. |
| UnsubscribedList | Displays a list of all members that have unsubscribed from the list |
| ThumbnailStripField | Provides a strip of thumbnails showing all of the images in the system. |
| MemberList | Represents a field in a form. |
Stores a reference to the FieldSet that contains this object.
Set the "tabindex" HTML attribute on the field.
Inherited from RequestHandlingData
RequestHandlingData::$allowed_actions
RequestHandlingData::$request
RequestHandlingData::$url_handlers
Inherited from ViewableData
ViewableData::$casting
ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache
Inherited from Object
Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Create a new field.
Add a CSS-class to the formfield-container.
Returns a version of a title suitable for insertion into an HTML attribute
Returns a version of a title suitable for insertion into an HTML attribute
Construct and return HTML tag
Returns the field value suitable for insertion into the data object
Describe this field, provide help text for it.
The function returns this so it can be used like this: $action = FormAction::create('submit', 'Submit')->describe("Send your changes to be approved")
Compiles all CSS-classes. Optionally includes a "nolabel"-class if no title was set on the formfield.
Returns the form field - used by templates.
Although FieldHolder is generally what is inserted into templates, all of the field holder templates make use of $Field. It's expected that FieldHolder will give you the "complete" representation of the field on the form, whereas Field will give you the core editing widget, such as an input tag.
Our base FormField class just returns a span containing the value. This should be overridden!
Returns a "Field Holder" for this field - used by templates.
Forms are constructed from by concatenating a number of these field holders. The default field holder is a label and form field inside a paragraph tag.
Composite fields can override FieldHolder to create whatever visual effects you like. It's a good idea to put the actual HTML for field holders into templates. The default field holder is the DefaultFieldHolder template. This lets you override the HTML for specific sites, if it's necessary.
This function is used by the template processor. If you refer to a field as a $ variable, it will return the $Field value.
Get tabindex (if previously set)
Get tabindex HTML string
Returns true if this field has its own data.
Some fields, such as titles and composite fields, don't actually have any data. It doesn't make sense for data-focused methods to look at them. By overloading hasData() to return false, you can prevent any data-focused methods from looking at it.
Returns the HTML ID of the field - used in the template by label tags.
The ID is generated as FormName_FieldName. All Field functions should ensure that this ID is included in the field.
Returns true if this field is a composite field.
To create composite field types, you should subclass CompositeField.
javascript handler Functions for each field type by default formfield doesnt have a validation function
Return a Link to this field
Returns the field message, used by form validation
Returns the field message type, used by form validation
Returns the field name - used by templates.
Takes a fieldname and converts camelcase to spaced words. Also resolves combined fieldnames with dot syntax to spaced words.
Return a disabled version of this field
Returns a readonly version of this field
Remove a CSS-class from the formfield-container.
Method to save this form field into the given data object.
By default, makes use of $this->dataValue()
Set the fieldset that contains this field.
Sets disabed-flag on form-field. Please use performDisabledTransformation() to actually transform this instance.
Sets the error message to be displayed on the form field
Set by php validation of the form
Set the container form.
This is called whenever you create a new form and put fields inside it, so that you don't have to worry about linking the two.
Set the field name
Sets readonly-flag on form-field. Please use performReadonlyTransformation() to actually transform this instance.
Set tabindex HTML attribute (defaults to none).
Set the field value.
Returns $this.
Returns a restricted field holder used within things like FieldGroups.
Returns the field label - used by templates.
Returns the field type - used by templates.
The field type is the class name with the word Field dropped off the end, all lowercase. It's handy for assigning HTML classes.
Validation Functions for each field type by default formfield doesnt have a validation function