Download the PHP package javihgil/genderize-io-bundle without Composer
On this page you can find all versions of the php package javihgil/genderize-io-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download javihgil/genderize-io-bundle
More information about javihgil/genderize-io-bundle
Files in javihgil/genderize-io-bundle
Download javihgil/genderize-io-bundle
More information about javihgil/genderize-io-bundle
Files in javihgil/genderize-io-bundle
Vendor javihgil
Package genderize-io-bundle
Short Description Integrates GenderizerIoClient library into Symfony
License MIT
Package genderize-io-bundle
Short Description Integrates GenderizerIoClient library into Symfony
License MIT
Please rate this library. Is it a good library?
Informations about the package genderize-io-bundle
GenderizeIoBundle
This bundle integrates GenderizeIoClient into Symfony Projects.
Install
-
Install package with composer:
- Add bundle to appKernel.php:
Configure
Configuration is not required (for the free version), but if you have an api key, you can use the simplest configuration:
For more extended configuration, for ex. caching, you can use the following:
Usage from a controller
/** @var Jhg\GenderizeIoClient\Model\Name $name */
$name = $this->get('genderizer')->recognize('John');
echo $name->getGender();
// shows "male"
Usage from twig
{{ 'John' | gender }}
{# paints "male" #}
{{ 'John' | genderInCountry('gb') }}
{# paints "male" #}
{{ 'John' | genderInLanguage('en') }}
{# paints "male" #}
{# consider using default filter after gender function for unknown cases #}
{{ 'Unknown Name' | gender | default('no genre') }}
{# paints "no gerne" #}
{% if isMale('John') %}
{# do something for male #}
{% else isFemale('John') %}
{# do something for male #}
{% else %}
{# do something for unknown cases #}
{% endif %}
All versions of genderize-io-bundle with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
twig/twig Version ~1.20
javihgil/genderize-io-client Version self.version
twig/twig Version ~1.20
javihgil/genderize-io-client Version self.version
The package javihgil/genderize-io-bundle contains the following files
Loading the files please wait ....