vsk / yii2-editablecolumn
Editable Column widget and module for Yii2
Installs: 1 425
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-10-24 05:38:57 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',
]);