vsk/yii2-editablecolumn

Editable Column widget and module for Yii2

1.0.0 2018-09-28 08:17 UTC

This package is auto-updated.

Last update: 2024-11-24 05:54:36 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

composer require vsk/yii2-editablecolumn

or add

"vsk/yii2-editablecolumn" : "~1.0.0"

to the require section of your application's composer.json file.

Usage

Single column example Include in config module

'modules' => [
    ...
     'editablecolumn' => [
            'class' => \vsk\editableColumn\module\EditableColumnModule::class,
        ]
    ...
]

Add scenario in you model

    public function rules()
    {
        return [
            ...
            [['email'], 'email', 'on' => [self::SCENARIO_DEFAULT, EditableColumn::MODEL_SCENARIO_EDITABLE_COLUMN]],
            ...
         ];
    }

Include in you view

<?php

 echo  \vsk\editableColumn\EditableColumn::widget([
                'model'=>$model,
                'attribute' => 'email',
                'format' => \kartik\editable\Editable::FORMAT_BUTTON,
                'asPopover' => true,
                'type'=>'success',
                'size'=>'lg',
            ]);