FormBuilderProcessor class

Located in file /site/modules/FormBuilder/FormBuilderProcessor.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FormBuilderProcessor class also inherits all the methods and properties of: WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
FormBuilderProcessor::action2 string URL to send duplicate submission to 
FormBuilderProcessor::action2_add array array of name=value to add to duplicate submission 
FormBuilderProcessor::action2_remove array array of field names to remove from duplicate submission 
FormBuilderProcessor::action2_rename array array of field names rename before duplicate submission 
FormBuilderProcessor::addEntryReady(array $data, InputfieldForm $form)
arrayCalled when new entry is about to be added. Return value is entry data that will be saved.
FormBuilderProcessor::addError(string $text)
(nothing)Add an error message that is shown to the user 
FormBuilderProcessor::addWarning(string $text)
(nothing)Add a warning that can be shown to user but does not prevent form submission 
FormBuilderProcessor::addedEntry(array $data, InputfieldForm $form)
arrayHook called after new entry has been added
FormBuilderProcessor::adminError(string $text)
(nothing)Add an error message that is ony shown if user has form-builder permission 
FormBuilderProcessor::akismet string CSV string containing field names of: "name,email,content" (in that order) 
FormBuilderProcessor::allowPreset bool allow form field values to be pre-set from GET variables? 
FormBuilderProcessor::allowSavePageField(Page $page, string $pageFieldName, string $formFieldName, string $value, array $entry)
boolReturns true if given value should be saved, false if not
FormBuilderProcessor::appendMarkup(string $markup)
(nothing)Add markup to append to the form 
FormBuilderProcessor::clearErrors()
(nothing)Clear all errors and warnings 
FormBuilderProcessor::emailForm(InputfieldForm $form, array $data)
bool intEmail the form result to the administrator(s)
FormBuilderProcessor::emailFormPopulateSkipFields(FormBuilderEmail $email, InputfieldForm $form)
(nothing)Called for all emails to specify field names to skip sending in email, i.e. `$email->setSkipFieldName($name);`
FormBuilderProcessor::emailFormReady(InputfieldForm $form, FormBuilderEmail $email)
boolCalled when $email object is ready, but message not yet sent.
FormBuilderProcessor::emailFormResponder(InputfieldForm $form, array $data)
boolEmail the form result to the sending (auto-responder)
FormBuilderProcessor::emailFormResponderReady(InputfieldForm $form, FormBuilderEmail $email)
boolCalled when $email object ready, but message not yet sent.
FormBuilderProcessor::emailFrom string email address (or field name where it resides) to use as the reply-to address for the email.  
FormBuilderProcessor::emailFrom2 string email from address, if different the one specified in module settings and reply-to address. 
FormBuilderProcessor::emailSubject string subject of email that gets sent 
FormBuilderProcessor::emailTo string email address to send form submissions to, may also be multiple (1 per line) or conditional (1 condition per line) 
FormBuilderProcessor::embedVer string 
FormBuilderProcessor::entries()
FormBuilderEntriesGet the FormBuilderEntries object for the current form
Can also be used as property: FormBuilderProcessor::entries
 
FormBuilderProcessor::errorMessage string message to display when a form error occurred 
FormBuilderProcessor::executePluginActions(string $methodName)
arrayRun a method on all FormBuilderProcessorAction (pluginAction) modules 
FormBuilderProcessor::fbForm FormBuilderForm 
FormBuilderProcessor::fbRender FormBuilderRender 
FormBuilderProcessor::formName string name of the form 
FormBuilderProcessor::formToEntry(InputfieldForm $form)
arrayConverts the submitted InputfieldForm object to an entry data array
FormBuilderProcessor::forms FormBuilder FormBuilder API variable 
FormBuilderProcessor::framework string form framework, if in use 
FormBuilderProcessor::get(string $key)
mixedGet property 
FormBuilderProcessor::getEntries()
FormBuilderEntriesGet the FormBuilderEntries object for the current form (legacy alias) 
FormBuilderProcessor::getEntry()
array nullGet the current form entry, or null if not present 
FormBuilderProcessor::getEntryID()
intGet the current entry ID, or 0 if not present 
FormBuilderProcessor::getErrors()
arrayReturn an array of errors that occurred (strings) 
FormBuilderProcessor::getFbForm()
FormBuilderFormGet current FormBuilderForm object 
FormBuilderProcessor::getFormArray()
arrayGet the array upon which this form is based (same as what was passed to constructor) 
FormBuilderProcessor::getFormUrl()
stringGet the URL for the given form 
FormBuilderProcessor::getInputfieldsForm()
InputfieldFormGet the constructed form 
FormBuilderProcessor::getSavePage()
NullPage PageGet page that was saved 
FormBuilderProcessor::getSubmitType()
bool int nullGet the form submit type 
FormBuilderProcessor::getValues()
arrayGet an array of all values from this form 
FormBuilderProcessor::getWarnings()
arrayReturn an array of warnings that occurred (strings) 
FormBuilderProcessor::googleSheetsResponseField string 
FormBuilderProcessor::googleSpreadsheetFields array 
FormBuilderProcessor::googleSpreadsheetUrl string 
FormBuilderProcessor::hasErrors()
boolAre there any errors present on form or in this processor? 
FormBuilderProcessor::honeypot string name of field that, when populated, invalidates the form submission 
FormBuilderProcessor::id int Form ID number 
FormBuilderProcessor::initError(string $text)
(nothing)Add an initialization error, must be called during initialization to be shown 
FormBuilderProcessor::isAdmin()
boolAre we currently in the FormBuilder admin? 
FormBuilderProcessor::isSpam()
bool stringReturns name of triggered spam filter when entry detected as spam 
FormBuilderProcessor::isSubmitted()
boolWas the form successfully submitted? (for public API) 
FormBuilderProcessor::loadEntry($entryID)
InputfieldFormLoad entry by ID or name and populate to form 
FormBuilderProcessor::mailer string Name of WireMail module to use for sending email, 'WireMail' for native PHP mail(), or blank for auto-detect.  
FormBuilderProcessor::maker()
FormBuilderMaker@return FormBuilderMaker
Can also be used as property: FormBuilderProcessor::maker
 
FormBuilderProcessor::pageSaver()
FormBuilderProcessorSavePage@return FormBuilderProcessorSavePage 
FormBuilderProcessor::partialEntries FormBuilderPartialEntries 
FormBuilderProcessor::pluginActions array 
FormBuilderProcessor::populate(array $data)
InputfieldFormPopulate the form with the key=value data given in the array
FormBuilderProcessor::postAction2(array $data)
boolSends data to external URL specified in action2_* form settings.
FormBuilderProcessor::postAction2Ready($http, array $data, $method, $url, array $headers)
bool stringCalled when ready to send to external URL. Returns response string or boolean false on fail.
FormBuilderProcessor::processInput($id, $submitType)
boolProcess input for submitted form. If $id is populated, it is the id of existing form entry.
FormBuilderProcessor::processInputDone(InputfieldForm $form)
(nothing)Called after $form->processInput() and spam filtering is completed.
FormBuilderProcessor::processInputIsSpam(InputfieldForm $form)
stringChecks for spam and returns name of spam filter that was triggered, or blank string if not spam.
FormBuilderProcessor::processInputReady(InputfieldForm $form, $submitType)
(nothing)Called right before $form->processInput() is called.
FormBuilderProcessor::processInputSpammed(InputfieldForm $form, string $spamType)
(nothing)Hook called when processInput fails due to being spammed
FormBuilderProcessor::render()
stringReturn the rendered form output, whether an actual form or the success message after submitted.
FormBuilderProcessor::renderError($error)
stringRender single error message into markup.
FormBuilderProcessor::renderErrors()
stringRender the given error messages for output
FormBuilderProcessor::renderErrorsReady(array $errors)
arrayCalled when errors ready to render, hooks can optionally modify $event->return array of errors.
FormBuilderProcessor::renderOrProcessReady(InputfieldForm $form, $submitType)
(nothing)Called when ready to render OR process. Added 0.4.7
FormBuilderProcessor::renderReady(InputfieldForm $form)
string) Called when ready to render, and returns rendered output. Note the $formFile and $vars arguments are only populated in embed method D.
FormBuilderProcessor::renderSubmitKey()
stringRender the submitKey in a hidden form field, ready to be output 
FormBuilderProcessor::renderSubmittedLandmark()
stringRender a markup landmark that indicates form was submitted (whether successfully or with errors)
FormBuilderProcessor::renderSuccess($message)
stringRender the given success message or success action string.
FormBuilderProcessor::renderSuccessMessage($message)
stringRender succcess message string only (called by renderSuccess).
FormBuilderProcessor::renderSuccessRedirect($url)
stringRender or execute a redirect to given $url (called by renderSuccess).
FormBuilderProcessor::responderBody string Body for the responder email 
FormBuilderProcessor::responderFrom string Email address that the responder email should be from 
FormBuilderProcessor::responderFromName string Name responder should be from 
FormBuilderProcessor::responderReplyTo string Responder reply-to address 
FormBuilderProcessor::responderSubject string Subject line for the responder email 
FormBuilderProcessor::responderTo string field name (not email address) that WILL contain the submittor's email address (where the responder should be sent). CSV string for multiple. 
FormBuilderProcessor::saveEntry(array $data)
intSave form entry
FormBuilderProcessor::saveFlags int Flags for saving form submission (default: self::saveFlagsDB) 
FormBuilderProcessor::saveFlagsLabels()
arrayGet array of labels for given saveFlags 
FormBuilderProcessor::saveForm(InputfieldForm $form)
intSave the form to the database entry, page, or email(s) per form action settings
FormBuilderProcessor::saveFormReady(InputfieldForm $form, array $entry, array $info)
(nothing)Hook called when form is about to be saved, has more info in arguments than saveForm() hook. Added 0.4.5
FormBuilderProcessor::saveGoogleSheets(InputfieldForm $form, array $data)
bool
FormBuilderProcessor::saveGoogleSheetsReady(GoogleSheets $sheets, array $row, array $data)
array
FormBuilderProcessor::saveLog(string $message)
(nothing)Save a log entry to the form-builder log 
FormBuilderProcessor::savePage(array $data)
Page nullSave the form entry to a Page
FormBuilderProcessor::savePageAdjustName bool int Adjust page name as needed to ensure it is unique? (default=true) 
FormBuilderProcessor::savePageCheckName(Page $page)
boolCheck and update page name as needed for uniqueness
FormBuilderProcessor::savePageDone(Page $page, array $data, bool $isNew, $onlyFields)
arrayHook called right after a page is saved
FormBuilderProcessor::savePageField(Page $page, string $name, string $value, array $entry)
boolReturns true if given value should be saved, false if not (DEPRECATED)
FormBuilderProcessor::savePageFields array array of 'processwire_field_id' => 'form_field_name' 
FormBuilderProcessor::savePageFileField(Page $page, Field $field, array $filenames, string $formFieldName)
intSave an individual files field to a Page
FormBuilderProcessor::savePageInit(array $data, $status, $onlyFields)
arrayGet settings for saving a page
FormBuilderProcessor::savePageParent string id of parent page 
FormBuilderProcessor::savePageReady(Page $page, array $data)
(nothing)Hook called right before a Page is about to be saved
FormBuilderProcessor::savePageStatus int status of saved page (0 = don't save page now) 
FormBuilderProcessor::savePageSubfields string Newline separated string in format: form_field_name=page_field_name.subfield 
FormBuilderProcessor::savePageTemplate string name of template 
FormBuilderProcessor::sessionGet(string $key)
mixed nullGet a session value unique for this form 
FormBuilderProcessor::sessionRemove(string $key)
(nothing)Remove a session value unique for this form 
FormBuilderProcessor::sessionSet(string $key, mixed $value)
(nothing)Set a session value unique for this form 
FormBuilderProcessor::set(string $key, mixed $value)
WireDataSet form processor setting 
FormBuilderProcessor::setEntry(array $data)
(nothing)Set current entry data 
FormBuilderProcessor::setFbForm(FormBuilderForm $fbForm)
(nothing)Set the FormBuilderForm instance 
FormBuilderProcessor::setFbRender(FormBuilderRender $renderer)
(nothing)Set the FormBuilderRender instance 
FormBuilderProcessor::setInputfieldsForm(InputfieldForm $form)
(nothing)Set the InputfieldForm 
FormBuilderProcessor::setSubmitType($submitType)
(nothing)Set the form submit type 
FormBuilderProcessor::showHidden bool Show input[type=hidden] as type=text instead? Option may only be modified in construct $options. (default=false) 
FormBuilderProcessor::skipSessionKey bool Require a unique session key for each form submission (for security) 
FormBuilderProcessor::spamFlags int Spam flags 
FormBuilderProcessor::spamWords array Keywords that flag a form submission as spam. 
FormBuilderProcessor::spammer()
FormBuilderProcessorSpam@return FormBuilderProcessorSpam 
FormBuilderProcessor::submitText string text that appears on the submit button 
FormBuilderProcessor::successMessage string message to display on successful form submission, assuming no successUrl was set 
FormBuilderProcessor::successUrl string URL to redirect to on successful form submission 
FormBuilderProcessor::turingTest array array containing list of field names and required answers 
FormBuilderProcessor::updateEntryReady(array $data, InputfieldForm $form)
arrayHook called when existing entry is about to be updated
FormBuilderProcessor::updatedEntry(array $data, InputfieldForm $form)
arrayHook called after existing entry has been updated
FormBuilderProcessor::useCookies bool Remember input values? 
FormBuilderProcessor::validSubmitKey()
bool stringWas posted submit key valid? 
FormBuilderProcessor::validateNumFields bool Validate quantity of fields present in form as part of the _submitKey? 
FormBuilderProcessor::wrapOutput(string $out)
stringWraps all FormBuilder output

Additional methods and properties

In addition to the methods and properties above, FormBuilderProcessor also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.234

Latest news

  • ProcessWire Weekly #511
    In the 511th issue of ProcessWire Weekly we'll cover the latest core updates, introduce a new third party module called Auto AVIF, and more. Read on!
    Weekly.pw / 25 February 2024
  • Using date range fields in ProcessWire
    This week we'll take a detailed look at the newest addition to the ProFields set of modules: the Date Range Fieldtype and Inputfield.
    Blog / 24 November 2023
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer