承接 lautr/qrcode-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lautr/qrcode-bundle

Composer 安装命令:

composer require lautr/qrcode-bundle

包简介

Endroid Qr Code Bundle for Symfony

README 文档

README

By endroid

Latest Stable Version Build Status Latest Stable Version Total Downloads License PayPayl donate button

This bundle provides a default controller for generating QR codes using the Endroid QR Code (endroid/QrCode) library.

knpbundles.com

Fork

This forks implements some barcode functionality

Requirements

Installation

Use Composer to install the bundle.

$ composer require endroid/qrcode-bundle

Then enable the bundle via the kernel.

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Endroid\Bundle\QrCodeBundle\EndroidQrCodeBundle(),
    );
}

Routing

Add the following section to your routing to be able to handle QR code URLs. This step can be skipped when you only use data URIs to display your images.

EndroidQrCodeBundle:
    resource:   "@EndroidQrCodeBundle/Controller/"
    type:       annotation
    prefix:     /qrcode

Configuration

The default QR code generation parameters can be overridden via the configuration. All parameters are optional.

config.yml

endroid_qr_code:
    size: 100
    padding: 10
    extension: gif
    error_correction_level: high
    foreground_color: { r: 0, g: 0, b: 0, a: 0 }
    background_color: { r: 255, g: 255, b: 255, a: 0 }
    label: "My label"
    labelFontSize: 16

Alpha channel available range is [0, 127] in foreground and background colors.

Twig extension

QR Codes

The bundle also provides a Twig extension for quickly generating QR code urls. Optional parameters are extension, size, padding and errorCorrectionLevel. When a parameter is omitted, the value in the bundle configuration is used.

<img src="{{ qrcode_url(message) }}" />
<img src="{{ qrcode_url(message, extension='png') }}" />
<img src="{{ qrcode_url(message, size=150) }}" />

You can also use the data URI helper to embed the QR code within your HTML instead of requiring a separate HTTP request to load your image.

<img src="{{ qrcode_data_uri(message, size=200, padding=10) }}" />

Bar Codes

<img src="{{ barcode_url(message) }}" />
<img src="{{ barcode_url(message, extension='png') }}" />
<img src="{{ barcode_url(message, size=150) }}" />
<img src="{{ barcode_url(message, type='Code128') }}" />

Usage

After installation and configuration, QR codes can be generated by appending the QR code text to the url as mounted, followed by .png, .jpg or .gif.

QR Code

Versioning

Semantic versioning (semver) is applied.

License

This bundle is under the MIT license. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

统计信息

  • 总下载量: 1.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 27
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固