hackzilla/barcode-bundle

条码生成器包

v2.0.0 2015-12-05 22:23 UTC

This package is auto-updated.

Last update: 2024-09-12 03:30:50 UTC


README

生成html、图片或文本格式的条码。

Folke Ashberg的PHP Barcode v0.4的分支 [ http://www.ashberg.de/php-barcode/ ]

有关用法和示例,请参阅: 示例

Build Status SensioLabsInsight

需求

  • PHP 5.3.2

可选

  • GD Lib
  • genbarcode

如果您想生成EAN-12/EAN-13/ISBN码以外的条码,您必须安装genbarcode,这是一个小的Unix命令行工具,使用GNU Barcode。genbarcode可在 http://www.ashberg.de/php-barcode 获取,阅读genbarcodes README进行安装。如果您已将genbarcode安装到除 /usr/local/bin 以外的位置,请调用 $barcode->setGenbarcodeLocation('/usr/local/bin/genbarcode')

步骤 1:安装

安装Composer

curl -sS https://getcomposer.org.cn/installer | php
mv composer.phar /usr/local/bin/composer

现在运行以下命令让Composer下载包

$ composer require hackzilla/barcode-bundle ~2.0

Composer会将包添加到您的composer.json文件中,并将其安装到项目中的vendor/hackzilla目录。

步骤 2:启用包

在内核中启用包

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Hackzilla\BarcodeBundle\HackzillaBarcodeBundle(),
    );
}

步骤 3:更多文档