承接 iliain/silverstripe-popup 相关项目开发

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

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

iliain/silverstripe-popup

最新稳定版本:1.0.0

Composer 安装命令:

composer require iliain/silverstripe-popup

包简介

Adds a field to quickly generate a CMS popup

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Adds a popup field to the CMS, to quickly build a popup form.

Thanks to sheadawson for his original Linkable module, I was able to mimic his use of entwine to set this up.

Installation (with composer)

composer require iliain/silverstripe-popup

Config

TODO

Usage

You can implement a PopupField like so:

// necessary config
$customLink = '/PopupForms/form';
$customBodyJS = <<<JS
    // custom js goes here
JS;

// method A
PopupField::create('PopupForm', 'I am a popup', $customLink, $customBodyJS);

// method B
PopupField::create('PopupForm', 'I am a popup')
    ->setFormURL($customLink)
    ->setFormCustomCode($customBodyJS);

You will need to provide your own URL to load the form HTML from, and JS to set what the popup will do/how it will submit. This will be inserted into the existing popup form code for you. Without it, the popup will open but fail to load any content/submit.

An example of the custom JS:

// On Button Click
this.getDialog().on('click', 'button', function () {
    $(this).addClass('loading ui-state-disabled');
});

// On Submit
this.getDialog().on('submit', 'form', function () {
    const options = {};
    options.success = function (response) {
        const button = self.getDialog().find('button');
        $(button).removeClass('loading ui-state-disabled');
    };

    $(this).ajaxSubmit(options);

    return false;
});

See the docs for a full example

TODO

  • Add more customisation functions?
  • Test multiple popups active on the same page

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2023-08-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固