diecoding/yii2-barcode-generator
最新稳定版本:v1.0.2
Composer 安装命令:
composer require diecoding/yii2-barcode-generator
包简介
The JavaScript Barcode Generator for Yii2
README 文档
README
The JavaScript Barcode Generator for Yii2
Yii2 Barcode Generator uses JsBarcode
Demo: https://lindell.me/JsBarcode/
Table of Contents
Instalation
Package is available on Packagist, you can install it using Composer.
composer require diecoding/yii2-barcode-generator "^1.0"
or add to the require section of your composer.json file.
"diecoding/yii2-barcode-generator": "^1.0"
Dependencies
- PHP 7.4+
- yiisoft/yii2
- npm-asset/jsbarcode
Usage
Wiki as JavaScript Code at https://github.com/lindell/JsBarcode/wiki#barcodes
Simple Usage
use diecoding\barcode\generator\Barcode; // CODE128 (auto) is the default mode Barcode::widget([ 'value' => 'Hi world!', ]); // CODE128 Barcode::widget([ 'value' => 'Example1234', 'format' => Barcode::CODE128 ]); // CODE128A Barcode::widget([ 'value' => 'EXAMPLE\n1234', 'format' => Barcode::CODE128A ]); // ...
Advanced Usage
use diecoding\barcode\generator\Barcode; Barcode::widget([ 'value' => '1234', 'format' => Barcode::PHARMACODE, 'pluginOptions' => [ 'lineColor' => '#0aa', 'width' => 4, 'height' => 40, 'displayValue' => false ] ]); // Enable encoding CODE128 as GS1-128/EAN-128. Barcode::widget([ 'value' => '12345678', 'format' => Barcode::CODE128C, 'pluginOptions' => [ 'ean128' => true, ] ]); // Change Element Tag, default svg, available svg, img, canvas Barcode::widget([ 'tag' => 'img', 'value' => '12345678', 'format' => Barcode::CODE128C, 'pluginOptions' => [ 'ean128' => true, ] ]); // Change Element Tag, add custom style element tag, hide value text Barcode::widget([ 'tag' => 'img', 'value' => '12345678', 'options' => [ 'style' => "width: 4cm; height: 1cm;", ], 'pluginOptions' => [ 'displayValue' => false, ], ]); // ...
Read more docs: https://sugengsulistiyawan.my.id/docs/opensource/yii2/barcode-generator/
统计信息
- 总下载量: 3.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-10