Bitrix API

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
$view : View
$widget : Widget

add()

Add field to form.

public add(Base|mixed $field) : $this
Parameters
$field : Base|mixed

Field to add.

Return values
$this

addClass()

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
$newField : Base

Field to add.

$targetField : Base

Target field after which to add.

addFieldBefore()

Add field before target field.

public addFieldBefore(Base $newField, Base $targetField) : void
Parameters
$newField : Base

Field to add.

$targetField : Base

Target field before which to add.

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
static

getAction()

Action url where to ubmit form.

public getAction() : string
Return values
string

getBoarId()

public getBoarId() : string
Return values
string

getClass()

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|null

getFields()

public getFields() : array<string|int, Base>
Return values
array<string|int, Base>

getId()

public getId() : string
Return values
string

getMethod()

public getMethod() : string
Return values
string

getName()

public getName() : string
Return values
string

getPostfix()

public getPostfix() : string
Return values
string

getPrefix()

public getPrefix() : string
Return values
string

render()

Collect all elements.

public render() : void

setAction()

public setAction(string $action) : $this
Parameters
$action : string

Url where to send form on submit.

Return values
$this

setBoarId()

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
$this

setId()

public setId(string $id) : void
Parameters
$id : string

Id value.

setMethod()

public setMethod(string $method) : $this
Parameters
$method : string

Get or post.

Return values
$this

setName()

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
Form

setPrefix()

public setPrefix(string $prefix) : $this
Parameters
$prefix : string

String to set as prefix of form.

Return values
$this

        
On this page

Search results