##This is a bundle to use http://www.hashids.org/ as a service
Composer is a project dependency manager for PHP. You have to list
your dependencies in a composer.json
file:
{
"require": {
"cayetanosoriano/hashids-bundle": "dev-master"
}
}
To actually install in your project, download the composer binary and run it:
wget http://getcomposer.org/composer.phar
# or
curl -O http://getcomposer.org/composer.phar
php composer.phar install
Finally, enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new cayetanosoriano\HashidsBundle\cayetanosorianoHashidsBundle(),
);
}
###Add the following to your config.yml
cayetanosoriano_hashids:
salt: "randomsalt" #optional
min_hash_length: 10 #optional
alphabet: "abcd..." #optional
$kcy = $this->get('hashids');