WidgetForm extends Form
Special form class wor widget configurations.
Table of Contents
Methods
- __construct() : mixed
- Construct widget form by view and widget
- add() : $this
- Add field to form.
- addClass() : void
- addDataAttribute() : void
- addFieldAfter() : void
- Add field after target field.
- addFieldBefore() : void
- Add field before target field.
- build() : static
- Building configuration form.
- getAction() : string
- Action url where to ubmit form.
- getBoarId() : string
- getClass() : array<string|int, mixed>
- getDataAttributes() : array<string|int, mixed>
- getErrors() : array<string|int, Error>
- Get Errors collections.
- getField() : Base|null
- getFields() : array<string|int, Base>
- getId() : string
- getMethod() : string
- getName() : string
- getPostfix() : string
- getPrefix() : string
- getView() : View
- getWidget() : Widget
- render() : void
- Collect all elements.
- setAction() : $this
- setBoarId() : void
- setClass() : void
- setDataAttributes() : $this
- setId() : void
- setMethod() : $this
- setName() : void
- setPostfix() : Form
- setPrefix() : $this
- setView() : void
- setWidget() : void
Methods
__construct()
Construct widget form by view and widget
public
__construct(View $view, Widget $widget) : mixed
Parameters
add()
Add field to form.
public
add(Base|mixed $field) : $this
Parameters
- $field : Base|mixed
-
Field to add.
Return values
$thisaddClass()
public
addClass(string $className) : void
Parameters
- $className : string
-
String to add as class name of form.
addDataAttribute()
public
addDataAttribute(string $key[, string $value = '' ]) : void
Parameters
- $key : string
-
Key for add data attribute. ('role').
- $value : string = ''
-
Value for add data attribute. ('remove button').
addFieldAfter()
Add field after target field.
public
addFieldAfter(Base $newField, Base $targetField) : void
Parameters
addFieldBefore()
Add field before target field.
public
addFieldBefore(Base $newField, Base $targetField) : void
Parameters
build()
Building configuration form.
public
static build(View $view, Widget $widget, array<string|int, mixed> $params) : static
Parameters
- $view : View
-
View controller.
- $widget : Widget
-
Widget entity.
- $params : array<string|int, mixed>
-
Parameters need for build form.
Return values
staticgetAction()
Action url where to ubmit form.
public
getAction() : string
Return values
stringgetBoarId()
public
getBoarId() : string
Return values
stringgetClass()
public
getClass() : array<string|int, mixed>
Return values
array<string|int, mixed>getDataAttributes()
public
getDataAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getErrors()
Get Errors collections.
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getField()
public
getField(string $key) : Base|null
Parameters
- $key : string
-
Unique key.
Return values
Base|nullgetFields()
public
getFields() : array<string|int, Base>
Return values
array<string|int, Base>getId()
public
getId() : string
Return values
stringgetMethod()
public
getMethod() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetPostfix()
public
getPostfix() : string
Return values
stringgetPrefix()
public
getPrefix() : string
Return values
stringgetView()
public
getView() : View
Return values
ViewgetWidget()
public
getWidget() : Widget
Return values
Widgetrender()
Collect all elements.
public
render() : void
setAction()
public
setAction(string $action) : $this
Parameters
- $action : string
-
Url where to send form on submit.
Return values
$thissetBoarId()
public
setBoarId(string $boarId) : void
Parameters
- $boarId : string
-
Board id.
setClass()
public
setClass(array<string|int, mixed> $class) : void
Parameters
- $class : array<string|int, mixed>
-
Array of strings to set as class names.
setDataAttributes()
public
setDataAttributes(array<string|int, mixed> $dataAttributes) : $this
Parameters
- $dataAttributes : array<string|int, mixed>
-
Data attributes key value pair array.
Return values
$thissetId()
public
setId(string $id) : void
Parameters
- $id : string
-
Id value.
setMethod()
public
setMethod(string $method) : $this
Parameters
- $method : string
-
Get or post.
Return values
$thissetName()
public
setName(string $name) : void
Parameters
- $name : string
-
Name value.
setPostfix()
public
setPostfix(string $postfix) : Form
Parameters
- $postfix : string
-
String to set as postfix fo form.
Return values
FormsetPrefix()
public
setPrefix(string $prefix) : $this
Parameters
- $prefix : string
-
String to set as prefix of form.
Return values
$thissetView()
public
setView(View $view) : void
Parameters
- $view : View
-
View controller.
setWidget()
public
setWidget(Widget $widget) : void
Parameters
- $widget : Widget
-
Widget entity.