PHP Класс unclead\multipleinput\components\BaseColumn

Наследование: extends yii\base\Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$attributeOptions client-side options of the attribute, e.g. enableAjaxValidation. You can use this property for custom configuration of the column (attribute). By default, the column will use options which are defined on widget level.
$context the context of using a column. It is an instance of widget(MultipleInput or TabularInput).
$defaultValue default value for input
$enableError whether to render inline error for the input. Default to false
$errorOptions the default options for the error tag
$headerOptions the HTML attributes for the header cell tag.
$items items which used for rendering input with multiple choice, e.g. dropDownList. It can be an array or anonymous function with following signature: 'columns' => [ ... [ 'name' => 'column', 'items' => function($data) { do your magic } .... ] ...
$name input name
$options array
$renderer the renderer instance
$title the header cell content. Note that it will not be HTML-encoded.
$type input type
$value string | Closure

Открытые методы

Метод Описание
getElementId ( null | integer $index = null ) : mixed Returns element id.
getElementName ( integer | null $index, boolean $withPrefix = true ) : string Returns element's name.
getFirstError ( $index ) : mixed
getModel ( ) : Model | yii\db\ActiveRecordInterface | array
init ( )
isHiddenInput ( ) : boolean
renderError ( string $error ) : string Renders an error.
renderInput ( string $name, array $options ) : string Renders the input.
setModel ( Model | yii\db\ActiveRecordInterface | array $model )

Защищенные методы

Метод Описание
ensureModel ( $model )
isEmpty ( $value )
prepareValue ( ) : mixed Prepares the value of column.
renderCheckbox ( string $name, mixed $value, array $options ) : string Renders checkbox.
renderCheckboxList ( string $name, mixed $value, array $options ) : string Renders checkbox list.
renderDefault ( $name, $value, $options ) : string Renders an input.
renderDropDownList ( $name, $value, $options ) : string Renders drop down list.
renderHiddenInput ( string $name, mixed $value, array $options ) : string Renders hidden input.
renderListBox ( string $name, mixed $value, array $options ) : string Renders list box.
renderRadio ( string $name, mixed $value, array $options ) : string Renders radio button.
renderRadioList ( string $name, mixed $value, array $options ) : string Renders radio button list.
renderStatic ( $name, $value, $options ) : string
renderWidget ( $type, $name, $value, $options ) : mixed Renders a widget.

Приватные методы

Метод Описание
normalize ( $name ) : mixed Normalization name.
prepareItems ( mixed $items ) : array | Closur\Closure | mixed Returns the items for list.

Описание методов

ensureModel() защищенный Метод

protected ensureModel ( $model )

getElementId() публичный Метод

Returns element id.
public getElementId ( null | integer $index = null ) : mixed
$index null | integer
Результат mixed

getElementName() абстрактный публичный Метод

Returns element's name.
abstract public getElementName ( integer | null $index, boolean $withPrefix = true ) : string
$index integer | null current row index
$withPrefix boolean whether to add prefix.
Результат string

getFirstError() абстрактный публичный Метод

abstract public getFirstError ( $index ) : mixed
$index
Результат mixed

getModel() публичный Метод

public getModel ( ) : Model | yii\db\ActiveRecordInterface | array
Результат yii\base\Model | yii\db\ActiveRecordInterface | array

init() публичный Метод

public init ( )

isEmpty() защищенный Метод

protected isEmpty ( $value )

isHiddenInput() публичный Метод

public isHiddenInput ( ) : boolean
Результат boolean whether the type of column is hidden input.

prepareValue() защищенный Метод

Prepares the value of column.
protected prepareValue ( ) : mixed
Результат mixed

renderCheckbox() защищенный Метод

Renders checkbox.
protected renderCheckbox ( string $name, mixed $value, array $options ) : string
$name string the name of input
$value mixed the value of input
$options array the HTMl options of input
Результат string

renderCheckboxList() защищенный Метод

Renders checkbox list.
protected renderCheckboxList ( string $name, mixed $value, array $options ) : string
$name string the name of input
$value mixed the value of input
$options array the HTMl options of input
Результат string

renderDefault() защищенный Метод

Renders an input.
protected renderDefault ( $name, $value, $options ) : string
$name
$value
$options
Результат string

renderDropDownList() защищенный Метод

Renders drop down list.
protected renderDropDownList ( $name, $value, $options ) : string
$name
$value
$options
Результат string

renderError() публичный Метод

Renders an error.
public renderError ( string $error ) : string
$error string
Результат string

renderHiddenInput() защищенный Метод

Renders hidden input.
protected renderHiddenInput ( string $name, mixed $value, array $options ) : string
$name string the name of input
$value mixed the value of input
$options array the HTMl options of input
Результат string

renderInput() публичный Метод

Renders the input.
public renderInput ( string $name, array $options ) : string
$name string the name of the input
$options array the HTML options of input
Результат string

renderListBox() защищенный Метод

Renders list box.
protected renderListBox ( string $name, mixed $value, array $options ) : string
$name string the name of input
$value mixed the value of input
$options array the HTMl options of input
Результат string

renderRadio() защищенный Метод

Renders radio button.
protected renderRadio ( string $name, mixed $value, array $options ) : string
$name string the name of input
$value mixed the value of input
$options array the HTMl options of input
Результат string

renderRadioList() защищенный Метод

Renders radio button list.
protected renderRadioList ( string $name, mixed $value, array $options ) : string
$name string the name of input
$value mixed the value of input
$options array the HTMl options of input
Результат string

renderStatic() защищенный Метод

protected renderStatic ( $name, $value, $options ) : string
$name
$value
$options
Результат string

renderWidget() защищенный Метод

Renders a widget.
protected renderWidget ( $type, $name, $value, $options ) : mixed
$type
$name
$value
$options
Результат mixed

setModel() публичный Метод

public setModel ( Model | yii\db\ActiveRecordInterface | array $model )
$model yii\base\Model | yii\db\ActiveRecordInterface | array

Описание свойств

$attributeOptions публичное свойство

client-side options of the attribute, e.g. enableAjaxValidation. You can use this property for custom configuration of the column (attribute). By default, the column will use options which are defined on widget level.
С версии: 2.1
public $attributeOptions

$context публичное свойство

the context of using a column. It is an instance of widget(MultipleInput or TabularInput).
public $context

$defaultValue публичное свойство

default value for input
public $defaultValue

$enableError публичное свойство

whether to render inline error for the input. Default to false
public $enableError

$errorOptions публичное свойство

the default options for the error tag
public $errorOptions

$headerOptions публичное свойство

the HTML attributes for the header cell tag.
public $headerOptions

$items публичное свойство

items which used for rendering input with multiple choice, e.g. dropDownList. It can be an array or anonymous function with following signature: 'columns' => [ ... [ 'name' => 'column', 'items' => function($data) { do your magic } .... ] ...
public $items

$name публичное свойство

input name
public $name

$options публичное свойство

public array $options
Результат array

$renderer публичное свойство

the renderer instance
public $renderer

$title публичное свойство

the header cell content. Note that it will not be HTML-encoded.
public $title

$type публичное свойство

input type
public $type

$value публичное свойство

public string|Closure $value
Результат string | Closure