wpjscc/wn-popupform-plugin
Composer 安装命令:
composer require wpjscc/wn-popupform-plugin
包简介
README 文档
README
The PopupForm plugin for WinterCMS provides a convenient way to handle form submissions within popup modals. This plugin extends the functionality of the FormController behavior to support popup forms.
Requirements
https://github.com/wintercms/winter/compare/develop...wpjscc-labs:winter:develop
php artisan winter:util compile js
Installation
To install this plugin, add it to your WinterCMS project using Composer:
composer require wpjscc/wn-popupform-plugin -vvv
Usage
Traits
The PopupFormTrait provides methods to handle form submissions and refresh the UI accordingly.
Methods
create_onSave($context = null): Handles the save action for the create form.update_onSave($recordId = null, $context = null): Handles the save action for the update form
Behaviors
The PopupFormController behavior extends the base ControllerBehavior to support popup forms.
Methods
onCreateForm($context = null): Renders the create form in a popup.
class Posts extends Controller { use \Wpjscc\PopupForm\Traits\PopupFormTrait; public $implement = [ ... \Wpjscc\PopupForm\Behaviors\PopupFormController::class, ]; }
<a onclick="$.popup({ url: '<?=Backend::url('wpjscc/popupform/fieldupdate/create') ?>' ,handler: 'onCreateForm_',extraData: {refresh_relation:'genjins',update_form:1, mode:'user_genjin'}}) "> <i class="wn-icon-plus"></i> </a>
onUpdateForm($recordId = null, $context = null): Renders the update form in a popup.
```html
<a onclick="$.popup({ url: '<?=Backend::url('wpjscc/popupform/fieldupdate/update/'.$record->id) ?>' ,handler: 'onUpdateForm_',extraData: {refresh_relation:'xxxx',update_form:1, mode:'xxx'}}) ">
<i class="wn-icon-edit"></i>
</a>
config_list.yaml
recordOnClick: "$.popup({ url: '/backend/winter/blog/posts/update/:id' ,handler: 'onUpdateForm_',extraData: {refresh_relation:'xxxx',update_form:1, mode:'xxx'}}) "
License
This plugin is licensed under the MIT License. See the LICENSE file for more details.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-03