Download the PHP package roukmoute/hashids-bundle without Composer
On this page you can find all versions of the php package roukmoute/hashids-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roukmoute/hashids-bundle
More information about roukmoute/hashids-bundle
Files in roukmoute/hashids-bundle
Package hashids-bundle
Short Description Integrates hashids/hashids in a Symfony project
License MIT
Informations about the package hashids-bundle
HashidsBundle
Integrates hashids/hashids in a Symfony project.
Installation using composer
These commands requires you to have Composer installed globally.
Open a command console, enter your project directory and execute the following
commands to download the latest stable version of this bundle:
Using Symfony Flex
Using Symfony Framework only
If this has not been done automatically, enable the bundle by adding the
following line in the config/bundles.php
file of your project:
Configuration
The configuration (config/packages/roukmoute_hashids.yaml
) looks as follows :
Usage
Next it's the same things of official documentation.
Hashids Converter
Converter Name: hashids.converter
The hashids converter attempts to convert any attribute set in the route into an integer parameter.
You could use hashid
or id
:
or
You could have several hashids in the same URL prefixed with _hash_
.
The keys must be the same as in parameters controller:
You will receive a LogicException
if a hash could not be decoded correctly.
Using auto_convert
auto_convert
tries to convert all arguments in controller.
Base on the example above:
It will not be possible to get an exception of type LogicException
from the
bundle if it is activated.
Using passthrough
passthrough
allows to continue with the next available param converters.
So if you would like to retrieve an object instead of an integer, just active
passthrough :
Base on the example above:
As you can see, the passthrough feature allows to use DoctrineParamConverter
or any another ParamConverterInterface
you would have created.
Twig Extension
Usage
All versions of hashids-bundle with dependencies
hashids/hashids Version ^4.1
sensio/framework-extra-bundle Version ^5.1 || ^6.0
symfony/http-kernel Version ^4.4 || ^5.3 || ^6.0
symfony/http-foundation Version ^4.4 || ^5.3 || ^6.0