vsk / yii2-editablecolumn
Editable Column widget and module for Yii2
Installs: 1 455
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- kartik-v/yii2-editable: ^v1.7.0
- yiisoft/yii2: ~2.0.0
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
'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',
]);