Yii2 widget to display a signature pad using https://github.com/INTELOGIE/signature_pad

Installs: 3 249

Dependents: 0

Suggesters: 0

Security: 0


0.0.1 2021-10-26 12:35 UTC

This package is auto-updated.

Last update: 2024-03-26 18:06:07 UTC


This extension provides a Signature Pad widget for Yii framework 2.0.

It wraps the INTELOGIE/signature_pad library.

Latest Stable Version


The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist diggindata/yii2-signaturepad

or add

"diggindata/yii2-signaturepad": "@dev"

to the require section of your composer.json, then run composer update.


In your form model, declare an attribute:

    public $signature;

    public function rules()
        return [
            ['signature', 'safe'],

In your form view file, include the widget:

    <?= SignaturePadWidget::widget([
        'model' => $model,
        'attribute' => 'signature',
        'options' => ['style' => 'min-width:300px;min-height:200px;'],
        'showSaveAsJpg' => false,
    ]) ?>


model - The form instance, either a yii\db\ActiveRecord or a yii\base\Model instance

attribute - the model's attribute name

showSaveAsJpg - Whether to show the Accept (JPG) and Save (JPG) buttons

showSaveAsPng - Whether to show the Accept (PNG) and Save (PNG) buttons