src/grid/DocumentGridView.php
public function columns()
    {
        return array_merge(parent::columns(), [
            'title' => [
                'format' => 'raw',
                'filterAttribute' => 'title_ilike',
                'value' => function ($model) {
                    return implode(' ', [
                        DocumentType::widget(['model' => $model]),
                        Html::a($model->getDisplayTitle(), ['@document/view', 'id' => $model->id]),
                    ]);
                },
            ],
            'state' => [
                'class' => RefColumn::class,
                'filterAttribute' => 'state_in',
                'format' => 'raw',
                'gtype' => 'state,document',
                'i18nDictionary' => 'hipanel:document',
                'value' => function ($model) {
                    return DocumentState::widget(['model' => $model]);
                },
            ],
            'type' => [
                'class' => RefColumn::class,
                'filterAttribute' => 'type_in',
                'format' => 'raw',
                'gtype' => 'type,document',
                'i18nDictionary' => 'hipanel:document',
                'value' => function ($model) {
                    return DocumentType::widget(['model' => $model]);
                },
            ],
            'actions' => [
                'class' => MenuColumn::class,
                'menuClass' => ClientActionsMenu::class,
            ],
            'size' => [
                'label' => Yii::t('hipanel:document', 'Size'),
                'value' => function ($model) {
                    return Yii::$app->formatter->asShortSize($model->file->size, 1);
                },
            ],
            'filename' => [
                'attribute' => 'file.filename',
                'label' => Yii::t('hipanel:document', 'Filename'),
            ],
            'create_time' => [
                'attribute' => 'file.create_time',
                'label' => Yii::t('hipanel:document', 'Create time'),
                'format' => 'datetime',
            ],
            'validity' => [
                'label' => Yii::t('hipanel:document', 'Validity'),
                'format' => 'raw',
                'value' => function ($model) {
                    return ValidityWidget::widget(['model' => $model]);
                },
            ],
            'statuses' => [
                'label' => Yii::t('hipanel:document', 'Statuses'),
                'format' => 'raw',
                'value' => function ($model) {
                    return DocumentStatuses::widget(['model' => $model]);
                },
            ],
            'object' => [
                'label' => Yii::t('hipanel:document', 'Related object'),
                'format' => 'raw',
                'value' => function ($model) {
                    return DocumentRelationWidget::widget(['model' => $model->object]);
                },
            ],
            'status_and_type' => [
                'label' => Yii::t('hipanel:document', 'Statuses'),
                'format' => 'raw',
                'value' => function ($model) {
                    return DocumentState::widget(['model' => $model]) . ' ' . DocumentStatusIcons::widget(['model' => $model]);
                },
            ],
        ]);
    }
public function columns()
    {
        return array_merge(parent::columns(), [
            'title' => [
                'format' => 'raw',
                'filterAttribute' => 'title_ilike',
                'value' => function ($model) {
                    return implode(' ', [
                        DocumentType::widget(['model' => $model]),
                        Html::a($model->getDisplayTitle(), ['@document/view', 'id' => $model->id]),
                    ]);
                },
            ],
            'state' => [
                'class' => RefColumn::class,
                'filterAttribute' => 'state_in',
                'format' => 'raw',
                'gtype' => 'state,document',
                'i18nDictionary' => 'hipanel:document',
                'value' => function ($model) {
                    return DocumentState::widget(['model' => $model]);
                },
            ],
            'type' => [
                'class' => RefColumn::class,
                'filterAttribute' => 'type_in',
                'format' => 'raw',
                'gtype' => 'type,document',
                'i18nDictionary' => 'hipanel:document',
                'value' => function ($model) {
                    return DocumentType::widget(['model' => $model]);
                },
            ],
            'actions' => [
                'class' => MenuColumn::class,
                'menuClass' => ClientActionsMenu::class,
            ],
            'size' => [
                'label' => Yii::t('hipanel:document', 'Size'),
                'value' => function ($model) {
                    return Yii::$app->formatter->asShortSize($model->file->size, 1);
                },
            ],
            'filename' => [
                'attribute' => 'file.filename',
                'label' => Yii::t('hipanel:document', 'Filename'),
            ],
            'create_time' => [
                'attribute' => 'file.create_time',
                'label' => Yii::t('hipanel:document', 'Create time'),
                'format' => 'datetime',
            ],
            'validity' => [
                'label' => Yii::t('hipanel:document', 'Validity'),
                'format' => 'raw',
                'value' => function ($model) {
                    return ValidityWidget::widget(['model' => $model]);
                },
            ],
            'statuses' => [
                'label' => Yii::t('hipanel:document', 'Statuses'),
                'format' => 'raw',
                'value' => function ($model) {
                    return DocumentStatuses::widget(['model' => $model]);
                },
            ],
            'object' => [
                'label' => Yii::t('hipanel:document', 'Related object'),
                'format' => 'raw',
                'value' => function ($model) {
                    return DocumentRelationWidget::widget(['model' => $model->object]);
                },
            ],
            'status_and_type' => [
                'label' => Yii::t('hipanel:document', 'Statuses'),
                'format' => 'raw',
                'value' => function ($model) {
                    return DocumentState::widget(['model' => $model]) . ' ' . DocumentStatusIcons::widget(['model' => $model]);
                },
            ],
        ]);
    }
public function columns ( ) { return array_merge ( parent :: columns ( ) , [ 'title' => [ 'format' => 'raw' , 'filterAttribute' => 'title_ilike' , 'value' => function ( $ model ) { return implode ( ' ' , [ DocumentType :: widget ( [ 'model' => $ model ] ) , Html :: a ( $ model -> getDisplayTitle ( ) , [ '@document/view' , 'id' => $ model -> id ] ) , ] ) ; } , ] , 'state' => [ 'class' => RefColumn :: class , 'filterAttribute' => 'state_in' , 'format' => 'raw' , 'gtype' => 'state,document' , 'i18nDictionary' => 'hipanel:document' , 'value' => function ( $ model ) { return DocumentState :: widget ( [ 'model' => $ model ] ) ; } , ] , 'type' => [ 'class' => RefColumn :: class , 'filterAttribute' => 'type_in' , 'format' => 'raw' , 'gtype' => 'type,document' , 'i18nDictionary' => 'hipanel:document' , 'value' => function ( $ model ) { return DocumentType :: widget ( [ 'model' => $ model ] ) ; } , ] , 'actions' => [ 'class' => MenuColumn :: class , 'menuClass' => ClientActionsMenu :: class , ] , 'size' => [ 'label' => Yii :: t ( 'hipanel:document' , 'Size' ) , 'value' => function ( $ model ) { return Yii :: $ app -> formatter -> asShortSize ( $ model -> file -> size , 1 ) ; } , ] , 'filename' => [ 'attribute' => 'file.filename' , 'label' => Yii :: t ( 'hipanel:document' , 'Filename' ) , ] , 'create_time' => [ 'attribute' => 'file.create_time' , 'label' => Yii :: t ( 'hipanel:document' , 'Create time' ) , 'format' => 'datetime' , ] , 'validity' => [ 'label' => Yii :: t ( 'hipanel:document' , 'Validity' ) , 'format' => 'raw' , 'value' => function ( $ model ) { return ValidityWidget :: widget ( [ 'model' => $ model ] ) ; } , ] , 'statuses' => [ 'label' => Yii :: t ( 'hipanel:document' , 'Statuses' ) , 'format' => 'raw' , 'value' => function ( $ model ) { return DocumentStatuses :: widget ( [ 'model' => $ model ] ) ; } , ] , 'object' => [ 'label' => Yii :: t ( 'hipanel:document' , 'Related object' ) , 'format' => 'raw' , 'value' => function ( $ model ) { return DocumentRelationWidget :: widget ( [ 'model' => $ model -> object ] ) ; } , ] , 'status_and_type' => [ 'label' => Yii :: t ( 'hipanel:document' , 'Statuses' ) , 'format' => 'raw' , 'value' => function ( $ model ) { return DocumentState :: widget ( [ 'model' => $ model ] ) . ' ' . DocumentStatusIcons :: widget ( [ 'model' => $ model ] ) ; } , ] , ] ) ; }
{@inheritdoc}
{