james2001/zxing-bundle

1.0.0 2014-12-14 20:20 UTC

This package is auto-updated.

Last update: 2024-09-14 05:26:54 UTC


README

使用 zxing (条形码读取器) 与 Symfony2

要求

此库包需要 PHP 5.3 或更高版本、Java、symfony/framework-bundle ~2.1 以及 james2001/zxing ~1.0

设置

  • 使用 composer (推荐)

将以下行添加到您的项目的 composer.json 中,并运行 composer install 命令

{
    "require": {
        "james001/zxing-bundle": "~1.0"
    }
}

从项目根目录启动安装

composer install --no-dev --prefer-dist

在 AppKernel.php 中添加捆绑

 $bundles = array(
 ...
new James2001\Bundle\ZxingBundle\James2001ZxingBundle(),
...
 );

使用

$imagePath = '/path/image.jpg';
$myCode = $this->get('james2001.zxing')->findFirst($imagePath);