PHP Class unclead\multipleinput\renderers\BaseRenderer

Inheritance: extends yii\base\Object, implements unclead\multipleinput\renderers\RendererInterface
Mostra file Open project: unclead/yii2-multiple-input

Public Properties

Property Type Description
$addButtonOptions the HTML options for the add button
$addButtonPosition position of add button. By default button is rendered in the row.
$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 string
$columns array of columns
$data input data
$form the instance of ActiveForm class.
$id the ID of the widget
$max maximum number of rows
$min minimum number of rows.
$removeButtonOptions the HTML options for the remove button
$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 widget object

Protected Properties

Property Type Description
$context unclead\multipleinput\TabularInput | unclead\multipleinput\MultipleInput

Public Methods

Method Description
getIndexPlaceholder ( ) : mixed
init ( )
render ( )
setContext ( $context )

Protected Methods

Method Description
initColumns ( ) Creates column objects and initializes them.
internalRender ( ) : mixed
isAddButtonPositionFooter ( ) : boolean
isAddButtonPositionHeader ( ) : boolean
isAddButtonPositionRow ( ) : boolean
prepareJsAttributes ( ) : array Prepares attributes options for client side.
prepareTemplate ( ) : string
registerAssets ( ) Register script.

Private Methods

Method Description
prepareButtons ( )
prepareColumnClass ( )
prepareIndexPlaceholder ( )
prepareMaxOption ( )
prepareMinOption ( )

Method Details

getIndexPlaceholder() public method

public getIndexPlaceholder ( ) : mixed
return mixed

init() public method

public init ( )

initColumns() protected method

Creates column objects and initializes them.
protected initColumns ( )

internalRender() abstract protected method

abstract protected internalRender ( ) : mixed
return mixed

isAddButtonPositionFooter() protected method

protected isAddButtonPositionFooter ( ) : boolean
return boolean

isAddButtonPositionHeader() protected method

protected isAddButtonPositionHeader ( ) : boolean
return boolean

isAddButtonPositionRow() protected method

protected isAddButtonPositionRow ( ) : boolean
return boolean

prepareJsAttributes() protected method

Prepares attributes options for client side.
protected prepareJsAttributes ( ) : array
return array

prepareTemplate() abstract protected method

abstract protected prepareTemplate ( ) : string
return string

registerAssets() protected method

Register script.
protected registerAssets ( )

render() public method

public render ( )

setContext() public method

public setContext ( $context )

Property Details

$addButtonOptions public_oe property

the HTML options for the add button
public $addButtonOptions

$addButtonPosition public_oe property

position of add button. By default button is rendered in the row.
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

public string $columnClass
return string

$columns public_oe property

array of columns
public $columns

$context protected_oe property

protected TabularInput,unclead\multipleinput|MultipleInput,unclead\multipleinput $context
return unclead\multipleinput\TabularInput | unclead\multipleinput\MultipleInput

$data public_oe property

input data
public $data

$form public_oe property

the instance of ActiveForm class.
public $form

$id public_oe property

the ID of the widget
public $id

$max public_oe property

maximum number of rows
public $max

$min public_oe property

minimum number of rows.
Since: 1.2.6 Use this option with value 0 instead of `allowEmptyList` with `true` value
public $min

$removeButtonOptions public_oe property

the HTML options for the remove button
public $removeButtonOptions

$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 widget object
public $rowOptions