FormItem
in package
Uses
EntityTrait
This class contains a form item, a form has several items
Tags
Table of Contents
- $formId : int
- $helpText : string
- $id : int
- $isFromAddress : bool
- $isRequired : bool
- $isSubject : bool
- $label : string
- $options : array<string|int, string>
- $placeholder : string|null
- $position : int
- $spamFilter : array<string|int, string>
- $type : string
- findByForm() : Iterator<string|int, FormItem>
- Gets the form items in the given form
- format() : array<string, array<string|int, string>|bool|int|string|null>
- Formats the form item into an array
- getForm() : Form|null
- Gets the form of the current form item
Properties
$formId
public
int
$formId
The ID of the form this form item belongs to
Tags
$helpText
public
string
$helpText
= ''
The help text of the form item, it is theme-dependent if and if yes, how they will be displayed
Tags
$id
public
int
$id
Tags
$isFromAddress
public
bool
$isFromAddress
= false
If true, this form items value is considered the from address in the submitted message and the artist will reply to this
Tags
$isRequired
public
bool
$isRequired
= false
If true, this form item is required and needs to be filled out
Tags
$isSubject
public
bool
$isSubject
= false
If true, this form items value will be used for the subject of the mail
Tags
$label
public
string
$label
The label of the form item
Tags
$options
public
array<string|int, string>
$options
= []
The options of the form item, only needed when the type is select
Tags
$placeholder
public
string|null
$placeholder
= ''
The placeholder text for the form element rendered, may be null
Tags
$position
public
int
$position
The position of the current entity
Tags
$spamFilter
public
array<string|int, string>
$spamFilter
= []
The spam filter contains a list of keywords, by which a submitted form is declared as spam. Messages marked as spam will not be sent to the recipient address of the form
Tags
$type
public
string
$type
= 'text'
The type of the form item, currently supported are select, checkbox and textarea. You can also specify any valid HTML5 form type
Tags
Methods
findByForm()
Gets the form items in the given form
public
static findByForm(int $id) : Iterator<string|int, FormItem>
Parameters
- $id : int
Tags
Return values
Iterator<string|int, FormItem> —format()
Formats the form item into an array
public
format() : array<string, array<string|int, string>|bool|int|string|null>
Tags
Return values
array<string, array<string|int, string>|bool|int|string|null> —getForm()
Gets the form of the current form item
public
getForm() : Form|null