PHP Класс yii2tech\admin\grid\VariationColumn

См. также: https://github.com/yii2tech/ar-variation
С версии: 1.0
Автор: Paul Klimov ([email protected])
Наследование: extends yii\grid\DataColumn
Показать файл Открыть проект

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

Свойство Тип Описание
$tableOptions the HTML attributes for the variation table element.
$variationAttribute name of the variation model attribute. If not set [[attribute]] value will be used.
$variationLabel variation label source. This should be either a string - variation option model attribute, which value should be used as variation label, or a callback of following signature: php function ($mainModel, $variationModel) { return string label }
$variationName model variation behavior name, which should be used by this column. It should refer to [[\yii2tech\ar\variation\VariationBehavior]] instance. If not set - model itself will be used for the method invocations.

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

Метод Описание
getVariationBehavior ( Model $model ) : yii2tech\ar\variation\VariationBehavior Gets the variation behavior from model.
getVariationLabel ( Model | yii2tech\ar\variation\VariationBehavior $mainModel, Model $variationModel ) : string Returns the variation label.
getVariationLabels ( Model $mainModel, string $labelAttribute ) : array Returns all available variation labels.
getVariationValue ( Model $variationModel ) : string Returns the variation value.
renderDataCellContent ( $model, $key, $index )

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

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

Gets the variation behavior from model.
protected getVariationBehavior ( Model $model ) : yii2tech\ar\variation\VariationBehavior
$model yii\base\Model model instance.
Результат yii2tech\ar\variation\VariationBehavior variation behavior instance.

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

Returns the variation label.
protected getVariationLabel ( Model | yii2tech\ar\variation\VariationBehavior $mainModel, Model $variationModel ) : string
$mainModel yii\base\Model | yii2tech\ar\variation\VariationBehavior main model instance.
$variationModel yii\base\Model variation model instance.
Результат string label.

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

Returns all available variation labels.
protected getVariationLabels ( Model $mainModel, string $labelAttribute ) : array
$mainModel yii\base\Model main model instance.
$labelAttribute string name of the attribute, which is used as label source.
Результат array list labels in format: optionPk => label

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

Returns the variation value.
protected getVariationValue ( Model $variationModel ) : string
$variationModel yii\base\Model variation model instance.
Результат string value.

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

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

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

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

the HTML attributes for the variation table element.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $tableOptions

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

name of the variation model attribute. If not set [[attribute]] value will be used.
public $variationAttribute

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

variation label source. This should be either a string - variation option model attribute, which value should be used as variation label, or a callback of following signature: php function ($mainModel, $variationModel) { return string label }
public $variationLabel

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

model variation behavior name, which should be used by this column. It should refer to [[\yii2tech\ar\variation\VariationBehavior]] instance. If not set - model itself will be used for the method invocations.
public $variationName