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

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #550
    In the 550th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module called PagefileMetadata, and more. Read on!
    Weekly.pw / 23 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK