kartik\grid\BooleanColumn::init PHP Метод

init() публичный Метод

public init ( )
    public function init()
    {
        if (empty($this->trueLabel)) {
            $this->trueLabel = Yii::t('kvgrid', 'Active');
        }
        if (empty($this->falseLabel)) {
            $this->falseLabel = Yii::t('kvgrid', 'Inactive');
        }
        $this->filter = [true => $this->trueLabel, false => $this->falseLabel];
        if (empty($this->trueIcon)) {
            /** @noinspection PhpUndefinedFieldInspection */
            $this->trueIcon = $this->grid->bootstrap ? GridView::ICON_ACTIVE : $this->trueLabel;
        }
        if (empty($this->falseIcon)) {
            /** @noinspection PhpUndefinedFieldInspection */
            $this->falseIcon = $this->grid->bootstrap ? GridView::ICON_INACTIVE : $this->falseLabel;
        }
        parent::init();
    }

Usage Example

Пример #1
1
 public function init()
 {
     if (empty($this->trueLabel)) {
         $this->trueLabel = Yii::t('yii', 'Yes');
     }
     if (empty($this->falseLabel)) {
         $this->falseLabel = Yii::t('yii', 'No');
     }
     parent::init();
 }
All Usage Examples Of kartik\grid\BooleanColumn::init