editablecolumn for Yii2 ¶
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 ¶
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',
]);
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.