Download the PHP package damess/zf2-hashids without Composer
On this page you can find all versions of the php package damess/zf2-hashids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zf2-hashids
ZF2 Hashids
Full documentation
This is a Zend Framework 2 module for the PHP Hashids library. See the full documentation of the library at http://hashids.org/php.
Requirements
- PHP 5.3.3 or higher
- Zend Framework 2.1 onwards
(Optional) GNU Multiple Precision or BCMath to allow integers greater than 1,000,000,000 to be encoded. See https://github.com/ivanakimov/hashids.php for more information.
Installation using Composer
Add the module to ./config/application.config.php
Options
The Hashids module has some options to allow you to quickly change the configuration. After installing the module, copy ./vendor/damess/zf2-hashids/config/hashids.global.php.dist to ./config/autoload/hashids.global.php and change the values as required.
- salt - Default value of ''. This is the value used when encoding an ID into a hash. Note: Please do not change this value once it's been set.
- min_length - Default value of 22. This defines the minimum length of the encoded hash value.
- alphabet - Default value of 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'. The alphabet used when encoding an ID. This must be at least 16 characters long and not contain any spaces.
Usage
This module provides a HashidsService and a controller plugin, see below for examples of use.
HashidsService
The HashidsService can be retrieved from the ServiceManager.
Inside a factory implementing Zend\ServiceManager\FactoryInterace
Inside a controller or class implementing Zend\ServiceManager\ServiceLocatorAwareInterface that's been retrieved from the ServiceManager
Controller plugin
The Hashids module provides a hashids controller plugin. This is how it can be used
All versions of zf2-hashids with dependencies
zendframework/zend-mvc Version 2.*
zendframework/zend-servicemanager Version 2.*
zendframework/zend-stdlib Version 2.*
hashids/hashids Version 1.0.*