errohitsinghal/yii2-ajaxcrud-bs5-advanced
Composer 安装命令:
composer require errohitsinghal/yii2-ajaxcrud-bs5-advanced
包简介
Gii CRUD template with password validation modal for Single Page Ajax Administration for yii2 with Bootstrap 5 support
README 文档
README
Gii CRUD template for Single Page Ajax Administration for yii2 with Password Validation Modal Support
Based on johnitvn/yii2-ajaxcrud and denkorolkov/yii2-ajaxcrud-bs5
Features
- Create, read, update, delete in onpage with Ajax
- Bulk delete support with optional password validation
- Pjax widget support
- Export function (PDF, HTML, Text, CSV, Excel, JSON)
- Bootstrap 5 support
- Password Modal for Critical Operations - Secure sensitive actions with passcode confirmation
- Customizable button text with Font Awesome icons
- Advanced modal dialogs with toast notifications
- Table-based modal content display
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist errohitsinghal/yii2-ajaxcrud-bs5-advanced "@dev"
or add
"errohitsinghal/yii2-ajaxcrud-bs5-advanced": "@dev"
to the require section of your composer.json file.
Usage
For first you must enable Gii module Read more about Gii code generation tool
Because this extension used kartik-v/yii2-grid extensions so we must config gridview module before
Let 's add into modules config in your main config file
'modules' => [ 'gridview' => [ 'class' => \kartik\grid\Module::class, 'bsVersion' => '5.x', // 'downloadAction' => 'gridview/export/download', // 'i18n' => [], // 'exportEncryptSalt' => 'tG85vd1', ] ]
Note: Font Awesome icons not required! See Bootstrap icons!
You can then access Gii through the following URL:
http://localhost/path/to/index.php?r=gii
and you can see Ajax CRUD Generator
Password Validation Modal
This advanced version includes secure password/passcode validation for critical operations like bulk delete.
Using Password Modal in Views
To enable passcode confirmation for delete or other critical operations, add these data attributes to your button:
<?php // In your view file echo Html::a('Delete', ['delete', 'id' => $model->id], [ 'class' => 'btn btn-danger', 'data' => [ 'confirm-title' => 'Confirm Delete', 'confirm-message' => 'Are you sure you want to delete this record?', 'confirm-passcode' => 'true', 'confirm-passcode-type' => 'Admin Password', 'confirm-passcode-value' => 'your-secret-code', 'confirm-ok' => 'Delete', 'confirm-cancel' => 'Cancel', 'request-method' => 'POST' ] ]); ?>
Modal Features
- validatePasscode: Enable/disable passcode validation (default: false)
- passcodeType: Label for passcode input (e.g., 'Admin Password', 'PIN')
- passcodeValue: The correct passcode to validate against
- Toast Notifications: Success/error messages with automatic display
- Form Validation: Built-in form submission handling
- Custom Callbacks: Define custom success and cancel callbacks
Available Modal Data Attributes
data-confirm-title: Modal titledata-confirm-message: Modal content/messagedata-confirm-passcode: Enable passcode validation (true/false)data-confirm-passcode-type: Passcode input labeldata-confirm-passcode-value: Correct passcode valuedata-confirm-ok: OK button labeldata-confirm-cancel: Cancel button labeldata-modal-size: Modal size (small/normal/large)data-request-method: HTTP method (GET/POST)hrefordata-url: Target URL for the action
Pjax Refresh on Modal Close
This extension supports automatic Pjax container refresh when a modal is closed. This is useful when you want to refresh a grid or other Pjax-wrapped content after a modal action is completed.
Usage
Add the data-pjax-refresh attribute to any button in your modal footer with the Pjax container ID as the value:
<?php // In your controller action that returns modal content return [ 'title' => '<i class="fa fa-sort-amount-down me-2"></i>Seeding: ' . Html::encode($eventStage->stage_name), 'size' => 'large', 'content' => $this->renderAjax($view, $viewParams), 'footer' => Html::button('Close', [ 'class' => 'btn btn-secondary', 'data-bs-dismiss' => 'modal', 'data-pjax-refresh' => $pjaxId // The ID of your Pjax container (without #) ]), ]; ?>
When the modal is closed (either by clicking the Close button or any other dismiss action), the Pjax container with the specified ID will automatically be refreshed.
Bootstrap 5 Classes
This extension fully supports Bootstrap 5 CSS classes including:
float-start/float-end(replaces pull-left/pull-right)btn-closefor modal close buttonform-label,form-control,invalid-feedbackfor formsis-invalid,is-validfor form validation statesalert-dangerfor error messages- All modern Bootstrap 5 utility classes
Contributing
Lets contribute to keep it updated and make it useful for all friends.
errohitsinghal/yii2-ajaxcrud-bs5-advanced 适用场景与选型建议
errohitsinghal/yii2-ajaxcrud-bs5-advanced 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「template」 「ajax」 「extension」 「crud」 「modal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 errohitsinghal/yii2-ajaxcrud-bs5-advanced 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 errohitsinghal/yii2-ajaxcrud-bs5-advanced 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 errohitsinghal/yii2-ajaxcrud-bs5-advanced 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Selenium4 (WebDriver) driver for Mink framework
laravel middleware to allow ajax only calls
Sitemap crawler/generator. For the given URL it will return sitemap XML file with URLs and images.
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-11-24