FormBuilder: Main

Provides the capability to build, edit and embed forms on your ProcessWire-powered web site.

When possible, please use the main FormBuilder class ($forms var) instead as this class will eventually be removed.


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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FormBuilderMain::addNew(string $formName)
FormBuilderForm

Add a new form with the given name

 
FormBuilderMain::count()
None

Return number of forms here, per Countable interface

 
FormBuilderMain::countEntries($form)
int

Return the number of entries for the given form ID

 
FormBuilderMain::delete(FormBuilderForm $form)
bool

Delete the given form

 
FormBuilderMain::entryToForm($entry)
bool FormBuilderForm

Given an entry array or ID return the FormBuilderForm object that it belongs to

 
FormBuilderMain::error(string $str)
None

Error message

 
FormBuilderMain::exportJSON($id)
string

Return the JSON schema for the given form ID

 
FormBuilderMain::findEntries(string $keywords)
array

Find form entries across all forms (or on specific form if specified)

 
FormBuilderMain::form($form)
FormBuilderForm bool

Convert given value to FormBuilderForm if it isn’t already

 
FormBuilderMain::formID($formID)
int

Convert given value to form ID if is isn’t already

 
FormBuilderMain::formName($formName)
int

Convert given value to form name if is isn’t already

 
FormBuilderMain::forms()
FormBuilder

@return FormBuilder

 
FormBuilderMain::frameworksPath()
string

Return the path where frameworks are stored

 
FormBuilderMain::frameworksURL()
string

Return the URL where frameworks are stored

 
FormBuilderMain::get($key)
FormBuilderForm null

Retrieve a form (alias of load)

 
FormBuilderMain::getDatabase()
PDO WireDatabasePDO

Get the $database API var

 
FormBuilderMain::getEmbedVersion()
None 
FormBuilderMain::getEntry(int $entryID)
array bool

Get a form entry by ID

 
FormBuilderMain::getFileFromKey(string $key)
bool string

Retrieve a filename from a transportable key

 
FormBuilderMain::getFileKey($formID, int $entryID, string $filename)
bool string

Generate a transportable key for the given filename within a form and entry

 
FormBuilderMain::getFilePath($form, int $entryID, string $filename)
bool

Get full disk path for given file basename

 
FormBuilderMain::getFileURL($formID, int $entryID, string $filename)
bool string

Return a URL where the given file can be viewed

 
FormBuilderMain::getFilesPath()
string

Return path that FormBuilder uses for storing files

 
FormBuilderMain::getFormNames()
array string

Get names for all forms indexed by id

 
FormBuilderMain::getFramework($form)
FormBuilderFramework null

Get the framework used by the given $form

 
FormBuilderMain::getHelpers($for)
array

Get all 'themes' or 'frameworks' files

 
FormBuilderMain::getIterator()
ArrayObject

Make this module iterable, as required by the IteratorAggregate interface

 
FormBuilderMain::helperPath(string $for)
string

Get path for 'themes' or 'frameworks' helpers

 
FormBuilderMain::helperURL(string $for)
string

Get URL for 'themes' or 'frameworks' helpers

 
FormBuilderMain::importJSON($id, string $json)
bool

Import the given JSON schema for the given form

 
FormBuilderMain::isForm($id)
bool

Given a form ID or name, returns true if is used by a form, false if not

 
FormBuilderMain::isReservedName(string $name)
bool

Returns whether or not the given $name may be used or a form or field name

 
FormBuilderMain::isValidLicense()
bool

Returns whether the given license key is valid for the domain its running on

 
FormBuilderMain::load($id)
FormBuilderForm array null

Retrieve a form by $id or $name or boolean true to return all forms

 
FormBuilderMain::parseFilesPath(string $path)
string

Given a path with a potential {config.paths.$key} in it, parse it to an actual runtime path

 
FormBuilderMain::save(FormBuilderForm $form)
bool

Save the given $form

 
FormBuilderMain::saveEntry(array $entry)
bool int

Save a form entry

 
FormBuilderMain::themesPath()
string

Return the path where themes are stored

 
FormBuilderMain::themesURL()
string

Return the URL where themes are stored

 
FormBuilderMain::viewFile(string $key)
bool

Outputs the given file, must be located under getFilesPath()

 
FormBuilderMain::wire()
ProcessWire Wire null

ProcessWire API access

 

API reference based on ProcessWire core version 3.0.252