Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alpin11/twig-barcode
A Symfony Bundle to generate SVG, HTML, JPEG and PNG barcodes within Twig 🏷️
https://github.com/alpin11/twig-barcode
symfony-bundle symfony3 symfony4 twig
Last synced: 3 months ago
JSON representation
A Symfony Bundle to generate SVG, HTML, JPEG and PNG barcodes within Twig 🏷️
- Host: GitHub
- URL: https://github.com/alpin11/twig-barcode
- Owner: alpin11
- License: lgpl-3.0
- Created: 2019-10-08T12:45:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-16T08:07:32.000Z (over 3 years ago)
- Last Synced: 2024-09-30T16:01:51.550Z (4 months ago)
- Topics: symfony-bundle, symfony3, symfony4, twig
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Twig Barcode
Generate barcodes within twig## Installation
Install through [composer](https://getcomposer.org/doc/00-intro.md):
```shell script
composer require alpin11/twig-barcode
```If you want to generate PNG or JPG images, you need the GD library or Imagick installed on your system as well.
### Usage
Simply use it like any other Twig function:
```twig
barcode_html_ean13(theBarcodeValue, widthFactor = 2, totalHeight = 30)
```### Options
#### Width Factor
With that option you can manipulate the width of the barcode. Default is `2`.
That means, the generated width of the barcode will be multiplied with you width factor.### Total Height
With that option you can set the height of the generated barcode. The default is value is `30`
### Supported Formats
#### HTML
```twig
barcode_html_*
```
#### SVG
```twig
barcode_svg_*
```
#### PNG
```twig
barcode_png_*
```
#### JPG
```twig
barcode_jpg_*
```### Supported Types
| Type | Twig Function |
|------|---------------|
| TYPE_CODE_39 | `barcode_*_c39` |
| TYPE_CODE_39_CHECKSUM | `barcode_*_c39_plus` |
| TYPE_CODE_39E | `barcode_*_c39e` |
| TYPE_CODE_39E_CHECKSUM | `barcode_*_c39e_plus` |
| TYPE_CODE_93 | `barcode_*_c93` |
| TYPE_STANDARD_2_5 | `barcode_*_s25` |
| TYPE_STANDARD_2_5_CHECKSUM | `barcode_*_s25_plus` |
| TYPE_INTERLEAVED_2_5 | `barcode_*_i25` |
| TYPE_INTERLEAVED_2_5_CHECKSUM | `barcode_*_i25_plus` |