__construct()
addElement()
addElements()
addRule()
addRules()
getAutoResponderBCC()
getAutoResponderBCCName()
getAutoResponderCC()
getAutoResponderCCName()
getAutoResponderEmailContent()
getAutoResponderFromAddress()
getAutoResponderFromName()
getAutoResponderHtml()
getAutoResponderReplyTo()
getAutoResponderSubject()
getAutoResponderToAddressField()
getAutoResponderTpl()
getCustomValidators()
getEmailBCCAddress()
getEmailBCCName()
getEmailCCAddress()
getEmailCCName()
getEmailFootHtml()
getEmailFromAddress()
getEmailFromName()
getEmailHeadHtml()
getEmailReplyToAddress()
getEmailReplyToName()
getEmailSubject()
getEmailToAddress()
getEmailToName()
getEmailTpl()
getHooks()
getId()
getJqueryValidation()
getMethod()
getPlaceholderJavascript()
getPostHookName()
getRedirectDocument()
getStore()
getValidate()
output()
outputRaw()
postHook()
postHookRaw()
processCoreHook()
processHooks()
setAutoResponderBCC()
setAutoResponderBCCName()
setAutoResponderCC()
setAutoResponderCCName()
setAutoResponderEmailContent()
setAutoResponderFromAddress()
setAutoResponderFromName()
setAutoResponderHtml()
setAutoResponderReplyTo()
setAutoResponderReplyToName()
setAutoResponderSubject()
setAutoResponderToAddressField()
setAutoResponderTpl()
setCustomValidators()
setDatabaseObjectForInsert()
setEmailBCCAddress()
setEmailBCCName()
setEmailCCAddress()
setEmailCCName()
setEmailFootHtml()
setEmailFromAddress()
setEmailFromName()
setEmailHeadHtml()
setEmailReplyToAddress()
setEmailReplyToName()
setEmailSubject()
setEmailToAddress()
setEmailToName()
setEmailTpl()
setHooks()
setJqueryValidation()
setMethod()
setPlaceholderJavascript()
setPostHookName()
setRedirectDocument()
setStore()
setValidate()
The main FormItBuilder methods. Most of the program bulk lives within this class and handles a great number of set/get methods and output methods.
package | FormItBuilder |
---|
__construct(\modx $modx, string $id)
The main construction for FormItBuilder. All elements and rules are attached to this object.
\modx
&$modx Reference to the core modX object
string
Id of the form
addElement(FormItBuilder_baseElement $o_formElement)
Adds a single element object to the main FormItBuilder object.
\FormItBuilder_baseElement
addElements(array $a_elements)
Adds multiple element objects to the main FormItBuilder object.
array
An array of objects that extend FormItBuilder_baseElement.
addRule(FormRule $formRule)
addRules(array $rules)
Adds multiple FormRule objects to the FormItBuilder object.
array
getAutoResponderBCC() : string
Auto Responder - Returns the Auto Responder BCC email address used in the email.
string
getAutoResponderBCCName() : string
Auto Responder - Returns the Auto Responder BCC email name used in the email.
string
getAutoResponderCC() : string
Auto Responder - Returns the Auto Responder CC email address used in the email.
string
getAutoResponderCCName() : string
Auto Responder - Returns the Auto Responder CC email name used in the email.
string
getAutoResponderEmailContent() : string
Auto Responder - Returns the Auto Responder email content.
string
getAutoResponderFromAddress() : string
Auto Responder - Returns the Auto Responder FROM email address used in the email.
string
getAutoResponderFromName() : string
Auto Responder - Returns the Auto Responder FROM email name used in the email.
string
getAutoResponderHtml() : boolean
Auto Responder - Returns the Auto Responder HTML setting used in the email.
boolean
getAutoResponderReplyTo() : string
Auto Responder - Returns the Auto Responder REPLY-TO email address used in the email.
string
getAutoResponderSubject() : string
Auto Responder - Returns the Auto Responder subject used in the email.
string
getAutoResponderToAddressField() : string
Auto Responder - Returns the Auto Responder TO email address FIELD used in the email.
string
getAutoResponderTpl() : string
Returns the Auto Responder template chunk used.
string
getCustomValidators() : string
Returns any customValidator settings used by the form. (Used with the FormIT "validate" command to create custom validation. See customValidators in FormIt documentation for more information).
string
getEmailBCCAddress() : string
Returns the BCC email address used when sending email.
string
getEmailBCCName() : string
Returns the BCC email name used when sending email.
string
getEmailCCAddress() : string
Returns the CC email address used when sending email.
string
getEmailCCName() : string
Returns the CC email name used when sending email.
string
getEmailFootHtml() : string
Returns the footer HTML used in the email.
string
getEmailFromAddress() : string
Returns the FROM email address used when sending email.
string
getEmailFromName() : string
Returns the FROM email name used when sending email.
string
getEmailHeadHtml() : string
Returns the header HTML used in the email.
string
getEmailReplyToAddress() : string
Returns the REPLY-TO email address used when sending email.
string
getEmailReplyToName() : string
Returns the REPLY-TO email name used when sending email.
string
getEmailSubject() : string
Returns the email subject used when sending email.
string
getEmailToAddress() : string
Returns the TO email address used when sending email.
string
getEmailToName() : string
Returns the TO email name used when sending email.
string
getEmailTpl() : array
Returns the email template chunks used by the FormIt call. By default this is set to use FormItBuilderEmailTpl which is an installed chunk containing a single placeholder to allow FormItBuilder to dynamically generate and create the chunk content on the fly.
array
getHooks() : array
Returns the list of hooks that are set in the formIT call. e.g. "spam","email","redirect" etc.
array
getId() : string
Returns the form ID.
string
getJqueryValidation() : boolean
Returns the forms jQuery validate setting.
boolean
getMethod() : string
Returns the form method (get, post etc)
string
getPlaceholderJavascript() : string
Returns javascript placeholder setting used.
string
getPostHookName() : string
Returns the post hook snippet name (normally set to the same snippet name for the FormItBuilder form)
string
getRedirectDocument() : string
Returns the forms redirectDocument setting.
string
getStore() : boolean
Returns the store option used. See the FormIt "store" option.
boolean
getValidate() : string
Returns the custom validation methods used (doesnt include the validation rules automatically set by rules etc).
string
output() : string
Output the FormItBuilder source.
string
outputRaw()
FOR DEBUGGING ONLY - Gets the FormItBuilder output source and prints to screen. Following this a hard exit is called. This allows users to see the raw FormIt syntax to ensure the source is written as expected.
postHook() : string
Gets the post hook email template chunk string.
string
postHookRaw()
FOR DEBUGGING ONLY - Gets the post hook string and echos it out followed by a hard exit. This allows users to see the raw FormIt syntax to ensure the source is written as expected.
processCoreHook(\hook $hook, \FormItBuilder $formObj) : boolean
Other hooks call this method which sets placeholder content for email and autoresponder template chunks.
\hook
Reference to the formIt hook object.
boolean
processHooks(array $a_hookCommands) : boolean
Called from the FormItBuilder_hooks snippet. Not intended to be called publically in any other way. This process should be automatic.
array
boolean
setAutoResponderBCC(string $value)
Auto Responder - Optional. A comma-separated list of emails to send via bcc.
string
setAutoResponderBCCName(string $value)
Auto Responder - Optional. A comma-separated list of names to pair with the fiarBCC values.
string
setAutoResponderCC(string $value)
Auto Responder - Optional. A comma-separated list of emails to send via cc.
string
setAutoResponderCCName(string $value)
Auto Responder - Optional. A comma-separated list of names to pair with the fiarCC values.
string
setAutoResponderEmailContent(string $value)
Auto Responder - Sets the email content.
string
setAutoResponderFromAddress(string $value)
Auto Responder - Optional. If set, will specify the From: address for the email. Defaults to the emailsender
system setting.
string
setAutoResponderFromName(string $value)
Auto Responder - Optional. If set, will specify the From: name for the email.
string
setAutoResponderHtml(boolean $value)
Auto Responder - Optional. Whether or not the email should be in HTML-format. Defaults to true.
boolean
setAutoResponderReplyTo(string $value)
Auto Responder - An email to set as the reply-to.
string
setAutoResponderReplyToName(string $value)
Auto Responder - Optional. The name for the Reply-To field.
string
setAutoResponderSubject(string $value)
Auto Responder - The subject of the email.
string
setAutoResponderToAddressField(string $value)
Auto Responder - The name of the form field to use as the submitters email. Defaults to "email".
string
setAutoResponderTpl(string $value)
Auto Responder - Tpl chunk for auto-response message.
string
setCustomValidators(string $value)
Sets the customValidator settings used by the form. (Used with the FormIT "validate" command to create custom validation. See customValidators in FormIt documentation for more information).
string
setDatabaseObjectForInsert(object $s_objName, array $a_mapping)
Sets the database table object to use to automatically insert the form information on a successful submission.
//Demo Table Mapping (Allows auto entry of data into an mysql Table (xPDO object)
$o_form->setDatabaseObjectForInsert('tableClass',array(
array($o_name,'name'),
array($o_address,'address'),
array($o_country,'country'),
));
object
The table class name used by the XPDO object.
array
Should contain an array which maps each form object to a field key within the table.
setEmailBCCAddress(string $value)
Sets the BCC email address used when sending email.
string
setEmailBCCName(string $value)
Sets the BCC email name used when sending email.
string
setEmailCCAddress(string $value)
Sets the CC email address used when sending email.
string
setEmailCCName(string $value)
Sets the FROM email name used when sending email.
string
setEmailFootHtml(string $value)
Sets the footer HTML used in the email.
string
setEmailFromAddress(string $value)
Sets the FROM email address used when sending email.
string
setEmailFromName(string $value)
Sets the FROM email address used when sending email.
string
setEmailHeadHtml(string $value)
Sets the header HTML used in the email.
string
setEmailReplyToAddress(string $value)
Sets the REPLY-TO email address used when sending email.
string
setEmailReplyToName(string $value)
Sets the REPLY-TO email name used when sending email.
string
setEmailSubject(string $value)
Sets the email subject used when sending email.
string
setEmailToAddress(string $value)
Sets the TO email address used when sending email.
string
setEmailToName(string $value)
Sets the TO email name used when sending email.
string
setEmailTpl(string $value)
Sets the email template chunk used by the FormIt call. By default this is set to use FormItBuilderEmailTpl which is an installed chunk containing a single placeholder to allow FormItBuilder to dynamically generate and create the chunk content on the fly.
string
setHooks(array $value)
Sets the list of hooks that are set in the formIT call. e.g. "spam","email","redirect" etc.
array
Array containing hook strings
setJqueryValidation(boolean $value)
Sets the forms jQuery validate setting. When set to true extra javascript is output for "jQuery Validate" to use. If jQuery Validate is installed correctly, forms should validate with inline javascript (jQuery) as well as with FormIt validation with PHP.
boolean
setMethod(string $value)
Sets the form method (get, post etc)
string
setPlaceholderJavascript(string $value)
Sets a placeholder to use to inject any javascript used to control the form (jQuery Validate etc). By default any javascript required for forms is output inline after the closeure of the form (as you can see when viewing the HTML source). This may not be desirable for some developers as javascript order may be an issue. For simplicity it has been set this way by default for the majority of users that want to get their form up and running with minimal fuss.
To do this add the following code to your form object.
$o_form->setPlaceholderJavascript('FormItBuilder_javascript_myForm');
The string used in this method will be your placeholder name. Simply add the placeholder code to your template like so
[[+FormItBuilder_javascript_myForm]]
string
setPostHookName(string $value)
Sets the post hook snippet name (normally set to the same snippet name for the FormItBuilder form).
string
setRedirectDocument(string $value)
Sets the forms redirectDocument setting (used if the redirect hook is also set).
string
The resource ID of the page to redirect to post success.
setStore(boolean $value)
Sets the store option used by FormIt. If true, will store the data in the cache for retrieval using the FormItRetriever snippet.
boolean
setValidate(string $value)
Sets the custom validation methods used (doesnt include the validation rules automatically set by rules etc).
string