FormBuilder
in package
Form builder class
Table of Contents
- $batch : mixed
- Multiple forms
- $entityName : string
- Entity name
- $fieldsAlgorithms : FieldsAlgorithms
- Fields algorithms
- $layout : array<string|int, mixed>
- Layout
- $sessionId : string
- Session id
- __construct() : mixed
- Constructor
- compileFormFields() : string
- Method compiles form fields
- creationForm() : string
- Method compiles creation form
- updatingForm() : string
- Method compiles updating form
- compileField() : string
- Method compiles atoic field
- compileForFieldsWithLayout() : string
- Method compiles form with layout
- compileForFieldsWithNoLayout() : string
- Method compiles form without layout
- getFormWidth() : string
- Method returns amount of columns in the form
Properties
$batch
Multiple forms
private
mixed
$batch
= false
$entityName
Entity name
private
string
$entityName
= ''
$fieldsAlgorithms
Fields algorithms
private
FieldsAlgorithms
$fieldsAlgorithms
$layout
Layout
private
array<string|int, mixed>
$layout
= []
$sessionId
Session id
private
string
$sessionId
= ''
Methods
__construct()
Constructor
public
__construct(FieldsAlgorithms $fieldsAlgorithms[, string $sessionId = '' ][, string $entityName = 'default' ][, array<string|int, mixed> $layout = [] ][, bool $batch = false ]) : mixed
Parameters
- $fieldsAlgorithms : FieldsAlgorithms
-
fields algorithms
- $sessionId : string = ''
-
session id
- $entityName : string = 'default'
-
entity name
- $layout : array<string|int, mixed> = []
-
fields layout
- $batch : bool = false
-
batch operations available
Return values
mixed —compileFormFields()
Method compiles form fields
public
compileFormFields(array<string|int, mixed> $record) : string
Parameters
- $record : array<string|int, mixed>
-
record to be filled
Return values
string —compiled fields
creationForm()
Method compiles creation form
public
creationForm() : string
Return values
string —compiled creation form
updatingForm()
Method compiles updating form
public
updatingForm(string $sessionId, array<string|int, mixed> $record) : string
Parameters
- $sessionId : string
-
session id
- $record : array<string|int, mixed>
-
record to be updated
Return values
string —compiled updating form
compileField()
Method compiles atoic field
protected
compileField(array<string|int, mixed> $field, string $name, array<string|int, mixed> $record) : string
Parameters
- $field : array<string|int, mixed>
-
field description
- $name : string
-
HTML field name
- $record : array<string|int, mixed>
-
record
Return values
string —Compiled field
compileForFieldsWithLayout()
Method compiles form with layout
protected
compileForFieldsWithLayout([array<string|int, mixed> $record = [] ]) : string
Parameters
- $record : array<string|int, mixed> = []
-
record
Return values
string —compiled fields
compileForFieldsWithNoLayout()
Method compiles form without layout
protected
compileForFieldsWithNoLayout(array<string|int, mixed> $record) : string
Parameters
- $record : array<string|int, mixed>
-
data
Return values
string —compiled control
getFormWidth()
Method returns amount of columns in the form
protected
getFormWidth() : string
Return values
string —width of the column