FormBehaviorTrait

Trait which supports form behavior.

since

4.0.0

package

Joomla CMS

Methods

getFormFactory

Get the FormFactoryInterface.

getFormFactory() : \Joomla\CMS\Form\FormFactoryInterface
abstract
since

4.0.0

throws

UnexpectedValueExceptionMay be thrown if the FormFactory has not been set.

Response

FormFactoryInterface

loadForm

Method to get a form object.

loadForm( name,  source = null, mixed||string|int options = [],  clear = false,  xpath = null) : \Joomla\CMS\Form\Form
see Form
since

4.0.0

throws

Exception

Arguments

name

stringThe name of the form.

source

stringThe form source. Can be XML string if file flag is set to false.

options

array<string|int, mixed>Optional array of options for the form creation.

clear

boolOptional argument to force load a new form.

xpath

stringAn optional xpath to search for the fields.

Response

Form

loadFormData

Method to get the data that should be injected in the form.

loadFormData() : mixed||string|int
since

4.0.0

Response

array<string|int, mixed>The default data is an empty array.

preprocessData

Method to allow derived classes to preprocess the data.

preprocessData( context,  &data,  group = 'content') : 
since

4.0.0

Arguments

context

stringThe context identifier.

data

mixedThe data to be processed. It gets altered directly.

group

stringThe name of the plugin group to import (defaults to "content").

Response

void

preprocessForm

Method to allow derived classes to preprocess the form.

preprocessForm(\Joomla\CMS\Form\Form form,  data,  group = 'content') : 
see FormField
since

4.0.0

throws

Exceptionif there is an error in the form event.

Arguments

form

FormA Form object.

data

mixedThe data expected for the form.

group

stringThe name of the plugin group to import (defaults to "content").

Response

void

Properties

_forms

Array of form objects.

since

4.0.0

Type(s)

array<string|int, Form>