commons / gender-bundle
Gendered User Interfaces and Form Types for human-centered web applications.
Installs: 80
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/commons/gender-bundle
Requires
- symfony/symfony: ~2.3
This package is auto-updated.
Last update: 2025-10-12 06:12:25 UTC
README
Since gender is not binary but Symfony documentation and tutorials and popular bundles play as if it were, this bundle attempts to be a starting point for Symfony web applications to offer humane choices for users to identify themselves.
Installation
Add the following code to your composer.json file:
"require": {
..
"commons/gender-bundle": "~1.0@dev"
},
And then run the Composer update command:
$ php composer.phar update commons/gender-bundle
Then register the bundle in the AppKernel.php file:
public function registerBundles()
{
$bundles = array(
...
new Commons\Bundle\GenderBundle\CommonsGenderBundle(),
...
);
return $bundles;
}
Configuration
Configuration is required for this bundle to function. Add the gender options your
application supports to your config.yml
commons_gender: genders: f: Feminine m: Masculine q: Genderqueer u: Undisclosed
These are the choices that will be available in the gender form type.
The gender form type extends from Symfony's choice form type, which means it
supports multiple. However it is your responsibility to create a data model that
supports multiple genders.
Interfaces
This bundle provides a generic GenderedUserInterface that all other gendered user
interfaces should extend from. The GenderedUserInterface tries to make no assumptions
and so only defines a GENDER_UNKNOWN constant.
Ambitions
The maintainers of this bundle will likely create a freegender form type which allows
free input with optional autocompletion.