2amigos/yii2-editable-widget
最新稳定版本:1.1.1
Composer 安装命令:
composer require 2amigos/yii2-editable-widget
包简介
X-Editable widget for Yii2.
README 文档
README
Renders a X-Editable Input allowing to use the amazing inline capabilities of X-Editable Plugin.
Important Note
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:
- The original library has been modified to port it to Yii2. Plugins that we thought didn't belong to the core, we extracted them and implemented them as separated external input types (address, combodate, datepicker, datetimepicker, select2 and wysihtml5 plugins). We thought that separating external types will help everybody to isolate problems and be able to improve the library much better.
- Plugins have been all updated to their latest versions
- Fixed datepicker and datetimepicker types to work with Bootstrap 3
- Refactored widget code to make it easier to understand
- We have not included EditableColumn, EditableListView, or EditableDetailView because we believe they correspond to a different package. They will be developed independently.
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:
- Widget is based on X-Editable not on X-Editable for Yii
- It does not work with JQuery UI or as plain JQuery, just Bootstrap and latest version only (not 2.3.2 sorry)
- If you wish to help improve the library do it, but do not update the library thinking this is the same as X-Editable source, it has been modified.
- The supported types are:
- text
- textarea
- select
- date
- datetime
- combodate
- html5 types
- checklist
- wysihtml5
- select2
- No typeaheadJs - ready for the challenge?
Installation
The preferred way to install this extension is through composer.
Either run
composer require 2amigos/yii2-editable-widget:~1.0 or add
"2amigos/yii2-editable-widget" : "~1.0"
to the require section of your application's composer.json file.
Usage
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' ] ] ]);?> Testing
To test the extension, is better to clone this repository on your computer. After, go to the extensions folder and do the following (assuming you have composer installed on your computer):
$ composer install --no-interaction --prefer-source --dev
Once all required libraries are installed then do:
$ vendor/bin/phpunit
Further Information
Please, check the X-Editable Plugin documentation for further information about its configuration options.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The BSD License (BSD). Please see License File for more information.
Custom Software | Web & Mobile Software Development
www.2amigos.us
2amigos/yii2-editable-widget 适用场景与选型建议
2amigos/yii2-editable-widget 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 194.29k 次下载、GitHub Stars 达 58, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「extension」 「yii」 「widget」 「yii2」 「x-editable」 「yii 2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 2amigos/yii2-editable-widget 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 2amigos/yii2-editable-widget 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 2amigos/yii2-editable-widget 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
UI Kit 3 Extension for Yii2
Adds more BBCode
统计信息
- 总下载量: 194.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 60
- 点击次数: 23
- 依赖项目数: 8
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-01-04