PHP Class unclead\multipleinput\MultipleInput

Author: Eugene Tupikov ([email protected])
Inheritance: extends yii\widgets\InputWidget
Mostra file Open project: unclead/yii2-multiple-input Class Usage Examples

Public Properties

Property Type Description
$addButtonOptions the HTML options for the add button
$addButtonPosition position of add button.
$allowEmptyList whether to allow the empty list
$attributeOptions client-side attribute options, e.g. enableAjaxValidation. You may use this property in case when you use widget without a model, since in this case widget is not able to detect client-side options automatically.
$columnClass the name of column class. You can specify your own class to extend base functionality. Defaults to unclead\multipleinput\MultipleInputColumn
$columns columns configuration
$data input data
$enableGuessTitle whether to guess column title in case if there is no definition of columns
$form an instance of ActiveForm which you have to pass in case of using client validation
$isEmbedded whether the widget is embedded or not.
$max maximum number of rows
$min minimum number of rows
$removeButtonOptions the HTML options for the remove button
$rendererClass the name of renderer class. Defaults to unclead\multipleinput\renderers\TableRenderer.
$rowOptions the HTML attributes for the table body rows. This can be either an array specifying the common HTML attributes for all body rows, or an anonymous function that returns an array of the HTML attributes. It should have the following signature: php function ($model, $index, $context) - $model: the current data model being rendered - $index: the zero-based index of the data model in the model array - $context: the MultipleInput widget object

Public Methods

Method Description
init ( ) Initialization.
run ( ) Run widget.

Protected Methods

Method Description
guessColumns ( ) This function tries to guess the columns to show from the given data if [[columns]] are not explicitly specified.
initData ( ) Initializes data.

Private Methods

Method Description
createRenderer ( ) : TableRenderer

Method Details

guessColumns() protected method

This function tries to guess the columns to show from the given data if [[columns]] are not explicitly specified.
protected guessColumns ( )

init() public method

Initialization.
public init ( )

initData() protected method

Initializes data.
protected initData ( )

run() public method

Run widget.
public run ( )

Property Details

$addButtonOptions public_oe property

the HTML options for the add button
public $addButtonOptions

$addButtonPosition public_oe property

position of add button.
public $addButtonPosition

$allowEmptyList public_oe property

whether to allow the empty list
public $allowEmptyList

$attributeOptions public_oe property

client-side attribute options, e.g. enableAjaxValidation. You may use this property in case when you use widget without a model, since in this case widget is not able to detect client-side options automatically.
public $attributeOptions

$columnClass public_oe property

the name of column class. You can specify your own class to extend base functionality. Defaults to unclead\multipleinput\MultipleInputColumn
public $columnClass

$columns public_oe property

columns configuration
public $columns

$data public_oe property

input data
public $data

$enableGuessTitle public_oe property

whether to guess column title in case if there is no definition of columns
public $enableGuessTitle

$form public_oe property

an instance of ActiveForm which you have to pass in case of using client validation
Since: 2.1
public $form

$isEmbedded public_oe property

whether the widget is embedded or not.
public $isEmbedded

$max public_oe property

maximum number of rows
public $max

$min public_oe property

minimum number of rows
public $min

$removeButtonOptions public_oe property

the HTML options for the remove button
public $removeButtonOptions

$rendererClass public_oe property

the name of renderer class. Defaults to unclead\multipleinput\renderers\TableRenderer.
Since: 1.4
public $rendererClass

$rowOptions public_oe property

the HTML attributes for the table body rows. This can be either an array specifying the common HTML attributes for all body rows, or an anonymous function that returns an array of the HTML attributes. It should have the following signature: php function ($model, $index, $context) - $model: the current data model being rendered - $index: the zero-based index of the data model in the model array - $context: the MultipleInput widget object
public $rowOptions