定制 micschk/silverstripe-signaturefield 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

micschk/silverstripe-signaturefield

最新稳定版本:v1.0.1

Composer 安装命令:

composer require micschk/silverstripe-signaturefield

包简介

A signaturefield based on https://github.com/szimek/signature_pad

README 文档

README

A silverstripe signature form field based on https://github.com/szimek/signature_pad

screenshot

Installation

composer require micschk/silverstripe-signaturefield

Usage

A signaturefield will be scaffolded if field is set to 'Signature' (field holds base64 png image of signature)

use Micschk\SignatureField\Signature;

class Contract extends DataObject {

	private static $db = array(
		'Signature' => Signature::class,
	);

}

Or explicitly add a SignatureField to a form (eg for non-scafolded formfields or front-end)

use Micschk\SignatureField\SignatureField;

...

	public function getCMSFields() {
		$fields = parent::getCMSFields();

		$fields->addFieldToTab('Root.Main',
				SignatureField::create('Signature')
			);

		return $fields;
	}

Front end use

If using this field on a front end form, outside of the CMS, jQuery is required. By default this module will load a packaged version of jQuery. This may conflict with existing versions if you have separately installed jQuery on your front end. To remove the included version of jQuery and make use of your own version, add the following to your yaml config

Micschk\SignatureField\SignatureField:
  include_jquery: false

Known Issues

Scaling issues may occur on high DPI screens: szimek/signature_pad#679

Development

The js is bundled using parcel.js. To make javascript changes

  1. run yarn install to install dependencies.
  2. make requisite changes in javascript/src/signature_pad.init.js
  3. run yarn build to compile changes

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-15