PHPackages                             diecoding/yii2-barcode-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. diecoding/yii2-barcode-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

diecoding/yii2-barcode-generator
================================

The JavaScript Barcode Generator for Yii2

v1.0.2(3y ago)33.4k↑300%MITPHPPHP &gt;=7.4.0

Since Apr 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wanforge/yii2-barcode-generator)[ Packagist](https://packagist.org/packages/diecoding/yii2-barcode-generator)[ GitHub Sponsors](https://github.com/sugeng-sulistiyawan)[ RSS](/packages/diecoding-yii2-barcode-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Yii2 Barcode Generator
======================

[](#yii2-barcode-generator)

The JavaScript Barcode Generator for Yii2

[![Latest Stable Version](https://camo.githubusercontent.com/71b1c8813346ff9ae5a13a98fbbb86a0cdfc395a240626b5a94f3ba3ddba49e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646965636f64696e672f796969322d626172636f64652d67656e657261746f723f6c6162656c3d737461626c65)](https://packagist.org/packages/diecoding/yii2-barcode-generator)[![Total Downloads](https://camo.githubusercontent.com/829d67970dcde5700733f2bb9a153fa42095e5bf0b788f60ee51d1be3b52a68e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646965636f64696e672f796969322d626172636f64652d67656e657261746f72)](https://packagist.org/packages/diecoding/yii2-barcode-generator)[![Latest Stable Release Date](https://camo.githubusercontent.com/2d261938921b3dd41994e08ef3fd0533a56f8f6384c97ddfcd716abc0a39a921/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f737567656e672d73756c69737469796177616e2f796969322d626172636f64652d67656e657261746f72)](https://github.com/sugeng-sulistiyawan/yii2-barcode-generator)[![Quality Score](https://camo.githubusercontent.com/0fb08569bb316579b625a5d46acace14f881e3ec04761400dda39f569f9e00fb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f737567656e672d73756c69737469796177616e2f796969322d626172636f64652d67656e657261746f72)](https://scrutinizer-ci.com/g/sugeng-sulistiyawan/yii2-barcode-generator)[![Build Status](https://camo.githubusercontent.com/dd108478c6836ee8d4b0487925b9f10bbb1b8ee82ba6c19286665f1e2fe2c380/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f737567656e672d73756c69737469796177616e2f796969322d626172636f64652d67656e657261746f72)](https://app.travis-ci.com/sugeng-sulistiyawan/yii2-barcode-generator)[![License](https://camo.githubusercontent.com/f254dc8d2a10334c628e54cfc9e5d8387bd98dbc2654876cbb850e24dabbac03/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f737567656e672d73756c69737469796177616e2f796969322d626172636f64652d67656e657261746f72)](https://github.com/sugeng-sulistiyawan/yii2-barcode-generator)[![PHP Version Require](https://camo.githubusercontent.com/410a2ca92869a423fe7b724144d1dccba3ea81cac0b6a3a3012134a92f4ed931/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f646965636f64696e672f796969322d626172636f64652d67656e657261746f722f7068703f636f6c6f723d366637336136)](https://packagist.org/packages/diecoding/yii2-barcode-generator)

> Yii2 Barcode Generator uses [JsBarcode](https://lindell.me/JsBarcode/)
>  Demo:

Table of Contents
-----------------

[](#table-of-contents)

- [Yii2 Barcode Generator](#yii2-barcode-generator)
    - [Table of Contents](#table-of-contents)
    - [Instalation](#instalation)
    - [Dependencies](#dependencies)
    - [Usage](#usage)
        - [Simple Usage](#simple-usage)
        - [Advanced Usage](#advanced-usage)

Instalation
-----------

[](#instalation)

Package is available on [Packagist](https://packagist.org/packages/diecoding/yii2-barcode-generator), you can install it using [Composer](https://getcomposer.org).

```
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
------------

[](#dependencies)

- PHP 7.4+
- [yiisoft/yii2](https://github.com/yiisoft/yii2)
- [npm-asset/jsbarcode](https://asset-packagist.org/package/npm-asset/jsbarcode)

Usage
-----

[](#usage)

> Wiki as JavaScript Code at

### Simple Usage

[](#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

[](#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:

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

3

Last Release

1117d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5fa8faeecf1f3d0da2d981ae5e4238e1590a7897b14b890663a0c49ef03e87a?d=identicon)[diecoding](/maintainers/diecoding)

---

Top Contributors

[![wanforge](https://avatars.githubusercontent.com/u/16300077?v=4)](https://github.com/wanforge "wanforge (15 commits)")

---

Tags

barcodebarcode-generatorjavascriptjavascript-libraryyii2yii2-extensionjavascriptbarcodebarcode generatoryii2widgetjavascript-library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/diecoding-yii2-barcode-generator/health.svg)

```
[![Health](https://phpackages.com/badges/diecoding-yii2-barcode-generator/health.svg)](https://phpackages.com/packages/diecoding-yii2-barcode-generator)
```

###  Alternatives

[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20144.4k11](/packages/softark-yii2-dual-listbox)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
