PHP 클래스 yii2tech\admin\grid\VariationColumn

또한 보기: https://github.com/yii2tech/ar-variation
부터: 1.0
저자: Paul Klimov ([email protected])
상속: extends yii\grid\DataColumn
파일 보기 프로젝트 열기: yii2tech/admin

공개 프로퍼티들

프로퍼티 타입 설명
$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