IMPORTANT All our Yii widgets will be discontinued as we are transitioning from a monolithic infrastructure into a microservice network and having the backend completely separated from frontend clients. We encourage you to avoid using PHP among with CSS/HTML/Javascript and move towards Modern FE technologies like Angular/React/Vue and mobile like ionic, react native, flutter.
So you can use directly: https://github.com/szimek/signature_pad
Draw and save signatures in Yii2
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist inquid/yii2-signature "dev-master"
or add
"inquid/yii2-signature": "dev-master"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
<?= \inquid\signature\SignatureWidget::widget(['clear' => true, 'undo' => true, 'change_color' => true, 'url' => 'google.com', 'save_server' => true]) ?>
Options available
url string
width string
height string
save_png boolean
save_jpg boolean
save_svg boolean
save_server boolean
clear boolean
change_color boolean
undo boolean
description boolean