fourclub/yii2-editable

extension

Yii2 editable

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist fourclub/yii2-editable "*"

or add

"fourclub/yii2-editable": "*"

to the require section of your composer.json.

Usage Editable column

In your gridview columns section

 [
    'class' => EditableColumn::className(),
    'attribute' => 'username',
    'url' => ['change-username'],
 ],

And add to your controller

 public function actions()
      {
          return [
              'change-username' => [
                  'class' => EditableAction::className(),
                  'modelClass' => UserModel::className(),
                  'forceCreate' => false
              ]
          ];
      }

Usage Editable widget

As a widget with a model

\fourclub\editable\Editable::widget( [
    'model' => $model,
    'attribute' => 'firstName',
    'url' => '/profile/update'
]);

With ActiveForm

echo $form->field($model, "firstName")->widget(\fourclub\editable\Editable::className(), [
    'url' => '/profile/update',
    'mode' => 'popup'
]);

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

  • 1.010 October 2015

Comments



1.0 is the latest of one release



MIT license
Stats
0 github stars & 0 github forks
0 downloads in the last day
0 downloads in the last 30 days
8 total downloads