FormBuilderMain class

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

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon.

Show class?             Show args?        

Common

NameReturnSummary 
addNew(string $formName)
FormBuilderFormAdd a new form with the given name 
count()
(nothing)Return number of forms here, per Countable interface 
countEntries($form)
intReturn the number of entries for the given form ID 
delete($form)
boolDelete the given form 
entryToForm($entry)
bool FormBuilderFormGiven an entry array or ID return the FormBuilderForm object that it belongs to 
error(string $str)
(nothing)Error message 
exportJSON($id)
stringReturn the JSON schema for the given form ID 
findEntries(string $keywords)
arrayFind form entries across all forms (or on specific form if specified) 
form($form)
FormBuilderForm boolConvert given value to FormBuilderForm if it isn’t already 
formID($formID)
intConvert given value to form ID if is isn’t already 
formName($formName)
intConvert given value to form name if is isn’t already 
frameworksPath()
stringReturn the path where frameworks are stored 
frameworksURL()
stringReturn the URL where frameworks are stored 
get($key)
FormBuilderForm nullRetrieve a form (alias of load) 
getDatabase()
PDO WireDatabasePDOGet the $database API var 
getEmbedVersion()
(nothing) 
getEntry(int $entryID)
array boolGet a form entry by ID 
getFileFromKey(string $key)
bool stringRetrieve a filename from a transportable key 
getFileKey($formID, int $entryID, string $filename)
bool stringGenerate a transportable key for the given filename within a form and entry 
getFilePath($form, int $entryID, string $filename)
boolGet full disk path for given file basename 
getFileURL($formID, int $entryID, string $filename)
bool stringReturn a URL where the given file can be viewed 
getFilesPath()
stringReturn path that FormBuilder uses for storing files 
getFormNames()
array stringGet names for all forms indexed by id 
getFramework($form)
FormBuilderFramework nullGet the framework used by the given $form 
getHelpers($for)
arrayGet all 'themes' or 'frameworks' files 
getIterator()
ArrayObjectMake this module iterable, as required by the IteratorAggregate interface 
helperPath(string $for)
stringGet path for 'themes' or 'frameworks' helpers 
helperURL(string $for)
stringGet URL for 'themes' or 'frameworks' helpers 
importJSON($id, string $json)
boolImport the given JSON schema for the given form 
isForm($id)
boolGiven a form ID or name, returns true if is used by a form, false if not 
isReservedName(string $name)
boolReturns whether or not the given $name may be used or a form or field name 
isValidLicense()
boolReturns whether the given license key is valid for the domain its running on 
load($id)
FormBuilderForm array nullRetrieve a form by $id or $name or boolean true to return all forms 
parseFilesPath(string $path)
stringGiven a path with a potential {config.paths.$key} in it, parse it to an actual runtime path 
save(FormBuilderForm $form)
boolSave the given $form 
saveEntry(array $entry)
bool intSave a form entry 
themesPath()
stringReturn the path where themes are stored 
themesURL()
stringReturn the URL where themes are stored 
viewFile(string $key)
boolOutputs the given file, must be located under getFilesPath() 
wire()
ProcessWire Wire nullProcessWire API access 

API reference based on ProcessWire core version 3.0.244

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer