bitverse / identicon-bundle
A Symfony 2 bundle for bitverse/identicon.
Installs: 330
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=5.4.0
- bitverse/identicon: 1.1.1
- symfony/config: ^2.7
- symfony/dependency-injection: ^2.7
Requires (Dev)
This package is not auto-updated.
Last update: 2025-02-01 20:06:02 UTC
README
This package contains a bundle which integrates bitverseio/identicon with a Symfony application.
Installation
Download the bundle using composer:
$ composer require bitverse/identicon-bundle
Enable the bundle in app/AppKernel.php
:
<?php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Bitverse\IdenticonBundle\BitverseIdenticonBundle(), ); // ... } // ... }
Configuration
BitverseIdenticonBundle allows you to specify the preprocessor and generator class, as well as the background color for the identicons. Here's the default configuration in YAML:
bitverse_identicon: preprocessor: class: Bitverse\Identicon\Preprocessor\MD5Preprocessor generator: class: Bitverse\Identicon\Generator\PixelsGenerator background_color: #EEEEEE
Usage
The bundle provides the identicon
service which is an instance of Bitverse\Identicon\Identicon
. You can use it to create icons directly:
$svg = $this->get('identicon')->getIcon('helloworld');
Or you can inject it as a dependency should you need it:
services: my_service: arguments: - @identicon