FormBuilderForm class
This stores all of the configuration data for a form and maintains FormBuilderField objects for the fields of the form.
It is also an intermediary between the a form array and an InputfieldForm
.
Please note that there are no hookable methods in this class.
// Loading a form
$form = $forms->load('form-name');
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Form
class also inherits all the methods and properties of: FormBuilderField and FormBuilderData.
- Retrieval
- Manipulation
- Pages
- Fields
- Output
- Tools
- Entries
- Pagination
- Flags
- Properties
- Spam
- Responder
- Dup submit
- Google sheets
Retrieval
Name | Return | Summary | |
---|---|---|---|
Form Form Form | bool | Does field with this name exist in the form? |
Manipulation
Name | Return | Summary | |
---|---|---|---|
Form Form Form | FormBuilderField | Create and add a new field by specifying name, type and label | |
Form Form Form | self | Remove the given field from this form | |
Form Form Form | bool | Save this form to the database | |
Form Form Form | self | Set form name |
Pages
Name | Return | Summary | |
---|---|---|---|
Form | array | Map of [ 'page field ID' => 'form field name' ] to translate page fields to/from form fields. | |
Form | int | Parent ID of page when saving form entries to pages | |
Form | int | Page status (int) to use for newly created pages. | |
Form | string | Multi-line text with form_field=page_field or form_field=page_field.subfield at one per line. | |
Form | int | ID of page template when saving form entries to pages |
Fields
Output
Name | Return | Summary | |
---|---|---|---|
Form | string | Default “back” button text | |
Form | string | Message to display if form has errors | |
Form | string | Default “next” button text | |
Form Form Form | string | Render this form's output and/or process if it has been posted. | |
Form | string | Default submit button text | |
Form | string | Message to display on successful form submission |
Tools
Entries
Name | Return | Summary | |
---|---|---|---|
Form Form Form | FormBuilderEntries | Get this form’s entries instance (FormBuilderEntries) | |
Form | int | Maximum days an entry is allowed to be saved in the system | |
Form | array | Field names to show in entries list by default | |
Form | int | Maximum days to allow an incomplete/partial entry to exist in the system | |
Form | int | Storage type to use for partial entries (0=session, 1=database) | |
Form | int | Maximum days a spam entry is allowed to be saved in the system |
Pagination
Name | Return | Summary | |
---|---|---|---|
Form Form Form | int | Return quantity of paginations found in form | |
Form Form Form | array | Get array of fields having type `FormBuilderPageBreak`, indexed by page number | |
Form | int | Headline level that is used above forms with pagination. 0=off, 1=H1, 2=H2, 3=H3, etc. | |
Form | int | Use select nav above paginations? 0=off, 1=before headline, 2=after healdline, 3=after description |
Flags
For use with the FormBuilderProcessor class formFlag* constants.
Name | Return | Summary | |
---|---|---|---|
Form Form Form | None | Add flag to form | |
Form Form Form | int | Does this form have the given flag? | |
Form Form Form | None | Remove flag from form |
Properties
Name | Return | Summary | Default |
---|---|---|---|
Form | bool int | Preset field values from GET variables? | false |
Form | string | Date of first submitted form entry | |
Form | int | Form flags, see the FormBuilderProcessor class formFlag* constants | |
Form | int | Alias of $flags $pw-internal | |
Form | string | Name of HTML/CSS framework used by this form | |
Form | int | Form ID | |
Form | string | Date of last submitted form entry | |
Form | int | Mobile responsive breakpoint for this form (in pixels). | |
Form | string | Form name | |
Form | int | Number of entries (form submissions) for this form | |
Form | int | Number of fields in this form | |
Form | array | Names of plugin actions enabled for this form | |
Form | array | Form roles for access control | |
Form | int | Bitwise flags for save actions (see FormBuilderProcessor class saveFlag* constants) | |
Form | bool int | Disable session tracking and CSRF protection? | false |
Form | string | Name of jQuery UI theme used by this form (if any) | |
Form | bool int | Remember form values in cookies? | false |
Spam
Name | Return | Summary | |
---|---|---|---|
Form | string | CSV data for Akismet configuration | |
Form | string array | Name of field in form to be used as a honeypot (or array of them if you prefer) | |
Form | int null | Spam flags to dictate what should happen when spam is detected (0=none, 2=silent, 4=verbose, 8=save spam entry) | |
Form | array null | If any of these words are present in form submission, it is considered spam (if spam words enabled) |
Settings for administrator email.
Name | Return | Summary | |
---|---|---|---|
Form | string | Email reply-to address (also used as from address if emailFrom2 not specified) | |
Form | string | Email from address (if different from emailFrom) | |
Form | string | Email subject line | |
Form | string | Email address, addresses, or format string to send form admin results to |
Responder
Settings for auto-responder email.
Name | Return | Summary | |
---|---|---|---|
Form | string | Body of auto-responder | |
Form | string | Responder from address | |
Form | string | Responder from "name" | |
Form | string | Reply-to email address for auto-responder | |
Form | string | Subject of auto-responder | |
Form | string | Field that will contain submitters email address (CSV string for multiple) |
Dup submit
Settings for sending a duplicate copy of the form submission to another URL.
Name | Return | Summary | |
---|---|---|---|
Form | string | Duplicate submission URL | |
Form | string | Add fields to duplicate submission (textarea format string) | |
Form | string | Newline separated field names to remove from duplicate submission | |
Form | string | Key=value format string of fields to rename in duplicate submission, one per line. |
Google sheets
To populate a Google Sheet you must have the GoogleClientAPI module installed.
Name | Return | Summary | |
---|---|---|---|
Form | string | Optional name of form field to populate Google Sheets response into. | |
Form | array null | Names of form fields to populate into Google Sheet, in order. | |
Form | string null | Full URL of Google Sheet to populate submitted form entries to. |
Additional methods and properties
In addition to the methods and properties above, Form
API reference based on ProcessWire core version 3.0.251