Bitrix API

Form implements IErrorable

Class Form

Table of Contents

Interfaces

IErrorable
Interface IErrorable

Methods

add()  : $this
Add field to form.
addClass()  : void
addDataAttribute()  : void
addFieldAfter()  : void
Add field after target field.
addFieldBefore()  : void
Add field before target field.
getAction()  : string
Action url where to ubmit form.
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
render()  : void
Collect all elements.
setAction()  : $this
setClass()  : void
setDataAttributes()  : $this
setId()  : void
setMethod()  : $this
setName()  : void
setPostfix()  : Form
setPrefix()  : $this

Methods

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.

getAction()

Action url where to ubmit form.

public getAction() : 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

Print form html.

setAction()

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

Url where to send form on submit.

Return values
$this

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