Easily set any displayed content as editable in Yii Framework 2.0. This is an enhanced editable widget for Yii 2.0 that allows easy editing of displayed data, using inputs, widgets and more with numerous configuration possibilities. The extension uses the enhanced yii2-popover-x extension as a popover modal for editing.
Note: This extension does not use any external jQuery plugin like X-Editable, instead it uses its own lean and extensible jQuery editable plugin - that elaborately reuses functionality available within Yii Framework 2.0.
- Set any readable markup on your view, DetailView, or GridView to be editable. Refer the EditableColumn details in kartik\grid\GridView for using an editable column in your grid..
- Provides two display formats for setting up your editable content .
- Link: Convert the editable content as a clickable link for popover.
- Button: Do not convert the editable content to a link, but rather display a button beside it for editing content.
- Uses Yii 2.0 ActiveForm for editing content. Hence all features of Yii ActiveForm, including model validation rules are available.
- For editing the content, you can configure it to use any of the HTML inputs, or widgets available from kartik-v/yii2-widgets or other input widgets from https://github.com/kartik-v. In addition, you can also use HTML 5 inputs or any custom input widget to edit your content.
- Entirely control the way the form content is displayed in the popover. By default, the widget displays the input to be edited. In addition, you can place more form fields or markup before and after this default input.
- Uses AJAX based form submission to process quick editing of data and provide a seamless user experience.
- Uses advanced features of the yii2-popover-x extension, to control display formats for your editable popover form. This uses the enhanced bootstrap-popover-x jQuery plugin by Krajee.
- Easily extend the default editable field by adding more form fields for editing before or after the generated editable input.
- Configure your own display value irrespective of the value stored internally.
- Configurable css styles and labels for rendering editable content according to your application or theme.
Note: This extension depends on the kartik-v/yii2-popover-x extension which in turn depends on the kartik-v/yii2-widgets extension and yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies. Note: Yii 2 framework is still in active development, and until a fully stable Yii2 release, your core yii2-bootstrap packages (and its dependencies) may be updated when you install or update this extension. You may need to lock your composer package versions for your specific app, and test for extension break if you do not wish to auto update dependencies.
You can see detailed documentation and demonstration on usage of the extension.
The preferred way to install this extension is through composer.
$ php composer.phar require kartik-v/yii2-editable "*"
require section of your
use kartik\editable\Editable; echo Editable::widget([ 'model'=>$model, 'attribute' => 'rating', 'type'=>'primary', 'size'=>'lg', 'inputType'=>Editable::INPUT_RATING, 'editableValueOptions'=>['class'=>'text-success h3'] ]);
yii2-editable is released under the BSD 3-Clause License. See the bundled
LICENSE.md for details.