|
1 рік тому | |
---|---|---|
.. | ||
assets | 1 рік тому | |
.gitignore | 1 рік тому | |
Editable.php | 1 рік тому | |
EditableAction.php | 1 рік тому | |
EditableAddressAsset.php | 1 рік тому | |
EditableBootstrapAsset.php | 1 рік тому | |
EditableComboDateAsset.php | 1 рік тому | |
EditableDatePickerAsset.php | 1 рік тому | |
EditableDateTimePickerAsset.php | 1 рік тому | |
EditableSelect2Asset.php | 1 рік тому | |
EditableWysiHtml5Asset.php | 1 рік тому | |
LICENSE.txt | 1 рік тому | |
README.md | 1 рік тому | |
Select2Asset.php | 1 рік тому | |
composer.json | 1 рік тому |
Renders a X-Editable Input allowing to use the amazing inline capabilities of X-Editable Plugin.
We decided to port only the Bootstrap 3 capabilities of X-Editable Plugin due to the requirements of our projects. We have done quite a lot of work:
So, if you have issues to fix, please remember, THIS IS NOT an exact copy of X-Editable, this is a Bootstrap 3 enhanced X-Editable plugin ported to Yii2.
We welcome everybody to improve this library with their amazing Pull Requests :) and we hope that this will increase the productivity of your Yii2 experience.
So keep this in mind:
The preferred way to install this extension is through composer.
Either run
php composer.phar require "2amigos/yii2-editable-widget" "*"
or add
"2amigos/yii2-editable-widget" : "*"
to the require section of your application's composer.json
file.
There is an amazing site made by Vitaliy Potapov which shows how to configure the widget. We are not going to explain how to use each one of the again and we encourage you to visit the documentation section of the plugin's site
<?php
use dosamigos\editable\Editable;
// as a widget with a model and a datetime type
?>
<?= Editable::widget( [
'model' => $model,
'attribute' => 'created_at',
'url' => 'site/test',
'type' => 'datetime',
'mode' => 'pop',
'clientOptions' => [
'placement' => 'right',
'format' => 'yyyy-mm-dd hh:ii',
'viewformat' => 'dd/mm/yyyy hh:ii',
'datetimepicker' => [
'orientation' => 'top auto'
]
]
]);?>
<?php
// as a widget without a model and a select2 type
?>
<?= Editable::widget( [
'name' => 'country_code',
'value' => '',
'url' => 'site/test',
'type' => 'select2',
'mode' => 'pop',
'clientOptions' => [
'pk' => 2,
'placement' => 'right',
'select2' => [
'width' => '124px'
],
'source' => [
['id' => 'gb', 'text' => 'Great Britain'],
['id' => 'es', 'text' => 'Spain'],
],
]
]);?>
<?php
// with an ActiveForm instance displayed as a address input
use dosamigos\editable\Editable;
?>
<?= $form->field($model, 'address')->widget(Editable::className(), [
'url' => 'site/test',
'type' => 'address'
]);?>
<?php
// as datetime type input
<?= $form->field($model, 'created_at')->widget(Editable::className(), [
'url' => 'site/test',
'type' => 'datetime',
'mode' => 'pop',
'clientOptions' => [
'placement' => 'right',
'format' => 'yyyy-mm-dd hh:ii',
'viewformat' => 'dd/mm/yyyy hh:ii',
'datepicker' => [
'orientation' => 'top auto'
]
]
]);?>
Please, check the X-Editable Plugin documentation for further information about its configuration options.
Web development has never been so fun!
www.2amigos.us