PHP Class yii2tech\admin\grid\PositionColumn

See also: https://github.com/yii2tech/ar-position
Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\grid\DataColumn
ファイルを表示 Open project: yii2tech/admin

Public Properties

Property Type Description
$buttonOptions html options to be applied to the [[initDefaultButtons()|default buttons]].
$buttons configuration for the switch position buttons.
$headerOptions
$positionParam name of the query param, which is used for new position specification.
$route route to the action, which should process position switching, for example: 'item/position'.
$template the template that is used to render the content in each cell. These default tokens are recognized: {first}, {prev}, {next}, {last} and {value}.
$urlCreator a callback that creates a button URL using the specified model information. The signature of the callback should be the same as that of PositionColumn::createUrl. If this property is not set, button URLs will be created using PositionColumn::createUrl.

Public Methods

Method Description
createUrl ( string $position, BaseActiveRecord $model, mixed $key, integer $index ) : string Creates a URL for the given position and model.
init ( )

Protected Methods

Method Description
initDefaultButtons ( ) Initializes the default buttons.
renderButton ( string $name, mixed $model, string $key, integer $index ) : string Renders button.
renderDataCellContent ( $model, $key, $index )

Method Details

createUrl() public method

This method is called for each button and each row.
public createUrl ( string $position, BaseActiveRecord $model, mixed $key, integer $index ) : string
$position string the position name
$model yii\db\BaseActiveRecord the data model
$key mixed the key associated with the data model
$index integer the current row index
return string the created URL

init() public method

public init ( )

initDefaultButtons() protected method

Initializes the default buttons.
protected initDefaultButtons ( )

renderButton() protected method

Renders button.
protected renderButton ( string $name, mixed $model, string $key, integer $index ) : string
$name string button name.
$model mixed
$key string
$index integer
return string rendered HTML

renderDataCellContent() protected method

protected renderDataCellContent ( $model, $key, $index )

Property Details

$buttonOptions public_oe property

html options to be applied to the [[initDefaultButtons()|default buttons]].
public $buttonOptions

$buttons public_oe property

configuration for the switch position buttons.
public $buttons

$headerOptions public_oe property

public $headerOptions

$positionParam public_oe property

name of the query param, which is used for new position specification.
public $positionParam

$route public_oe property

route to the action, which should process position switching, for example: 'item/position'.
public $route

$template public_oe property

the template that is used to render the content in each cell. These default tokens are recognized: {first}, {prev}, {next}, {last} and {value}.
public $template

$urlCreator public_oe property

a callback that creates a button URL using the specified model information. The signature of the callback should be the same as that of PositionColumn::createUrl. If this property is not set, button URLs will be created using PositionColumn::createUrl.
public $urlCreator