Download the PHP package acelaya/zf2-acqrcode without Composer

On this page you can find all versions of the php package acelaya/zf2-acqrcode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zf2-acqrcode

ZF-AcQrCode

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Total Downloads License

This Zend Framework module allows you to easily generate QR codes by using the Endroid QR Code library, by Endroid.

It has been based on the EndroidQrCodeBundle Symfony bundle.

Installation

The preferred installation method is by using composer. Just require this package with composer

and update your dependencies with composer php composer.phar update

After that you just need to add the module to the list of enabled modules in you application.config.php file

Usage

The module can be used in many ways. It includes a route which points to a controller which returns the QR code image as a response.

You can simply use that route to create your own QR codes by passing four simple arguments. The message to be encoded, the extension of the image (jpeg, png or gif), the size of the image and the padding.

In your view template do something like this.

By default the extension is jpeg, the size is 200 and the padding is 10. The message has to be provided.

Default values can be customized by copying the file vendor/acelaya/zf2-acqrcode/config/qr_code.global.php.dist to config/autoload/qr_code.global.php and replacing any of the params defined there.

The view helper

To ease that task, a view helper is provided. By using it you can directly render img tags pointing to that QR code or just get the assembled route just like you would do with the url view helper.

All the methods in this view helper get the 4 params in the same order; the message, the extension, the size and finally the padding.

This will produce this image

If you need additional attributes in the img tag, if the last argument is an array, it will be treated as the attributes and their values.

This will produce this image:

You can also render a base64-encoded image, instead of using an internal route. This is very useful when you need to render URLs, which is one of the most common use cases.

This will produce this image:

In both cases, if your application is XHTML, the image tag will be automatically closed with />. If it is HTML5 it will be closed with just >

If you just need to get the route, this view helper is a shortcut to the url view helper when used like this.

If you need additional route options to be used, it can be done like this.

The service

If that view helper does not fit your needs, or you need to do something else with the QR codes, like saving them to some storage system, you can directly use the QrCodeService.

It has been registered with the key Acelaya\QrCode\Service\QrCodeService in order for you to inject it to any of your own services.

The returned object is a Acelaya\QrCode\Service\QrCodeService which implements Acelaya\QrCode\Service\QrCodeServiceInterface.

The getQrCodeContent method accepts the four params in the same order ($message, $extension, $size, $padding), being the first, the only mandatory argument.

Additionally you can pass a Zend\Controller\Plugin\Params object as the first param, in order to get the information from route params, ignoring the rest of the arguments passed.

Testing

This module includes all its unit tests and follows dependency injection and abstraction for you to be able to test any component that depend on its classes.


All versions of zf2-acqrcode with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 | ^7.0
endroid/qrcode Version ^1.6
zendframework/zend-mvc Version ^3.0
zendframework/zend-router Version ^3.0
zendframework/zend-servicemanager Version ^3.0
zendframework/zend-view Version ^2.8
zendframework/zend-modulemanager Version ^2.7
zendframework/zend-http Version ^2.6
zendframework/zend-eventmanager Version ^3.0
zendframework/zend-stdlib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package acelaya/zf2-acqrcode contains the following files

Loading the files please wait ....