承接 sem-soft/yii2-ajax-confirm 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sem-soft/yii2-ajax-confirm

Composer 安装命令:

composer require sem-soft/yii2-ajax-confirm

包简介

Submit button widget with ajax asking for confirm displaying

README 文档

README

Install by composer

composer require sem-soft/yii2-ajax-confirm

Or add this code into require section of your composer.json and then call composer update in console

"sem-soft/yii2-ajax-confirm": "~1.0"

Description

Implements the logic of submit button widget with server-side confirmation message or without them. Used when additional data verification is required on the server side, and not just a standard confirmation of the action.

Basic usage

Example of configuration in view:

    <?php $form = ActiveForm::begin([
        'id' => 'report_import_form',
        'options' => [
            'enctype' => 'multipart/form-data'
        ],
        'enableAjaxValidation' => false,
    ]); ?>
        ...
        <?= $form->errorSummary(($model), [
            'class' => 'alert alert-error'
        ]); ?>
        ...
         <?= SubmitButtonWidget::widget([
             'form' => $form,
             'confirmRoute' => ['exists'],
             'content' => 'Загрузить',
             'options' => [
                 'class' => 'btn btn-success btn-block',
            ]
         ]);?>
    <?php ActiveForm::end(); ?>

Example of action for check:

  ...
  public function actionExists()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;

     ...

     $form = new FinanceReportImportForm();

     ...

     if ($existReport = FinanceReport::findOne([
         'field1' => $form->field1,
         'field2' => $form->field2
     ])) {
         $question = "Отчет по {$existReport->field1} кварталу {$existReport->field2} отчетного года уже существует и будет перезаписан. Продолжить импорт?";
     } else {
         $question = "Выполнить импорт?";
     }

     ...

     return [
         'can' => $existReport ? false : true,
         'question' => $question
     ];
 }
...

统计信息

  • 总下载量: 854
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固