xynnn / blacklisted-email-validator-bundle
An extended email address validator which validates against blacklisted hostnames for Symfony 2
Requires
- php: >=5.6
- symfony/form: >=2.7
- symfony/framework-bundle: >=2.7
- symfony/validator: >=2.7
Requires (Dev)
- matthiasnoback/symfony-dependency-injection-test: ^0.7.6
- mockery/mockery: ^0.9.4
- phpunit/phpunit: 4.8
This package is auto-updated.
Last update: 2024-11-14 03:56:14 UTC
README
An extended email address validator which validates against blacklisted hostnames for Symfony 2. It's designed for easy usage! Install it in a Symfony project or also use it as framework-agnostic library.
Requirements
- PHP 5.6 and higher
- Symfony 2.7 and higher
Installation
Install this bundle with composer:
composer require xynnn/blacklisted-email-validator-bundle
Register the bundle in app/AppKernel.php
public function registerBundles()
{
$bundles = [
// ...
new Xynnn\BlacklistedEmailValidatorBundle\XynnnBlacklistedEmailValidatorBundle(),
];
}
Usage
Add the new registered Constraint to your models or get it from the service container as a standalone service like every time. For more information about the Symfony validation package please look at The Symfony Book.
Normally without to adjust the configuration it will blacklist the hostnames which are defined in the service definition under Resources/config/services.xml
. You can override these defaults with the provided configuration ability.
xynnn_blacklisted_email_validator:
strict: true // Enable strict mode for email validator
hosts: ["domain1.com", "domain2.com"]
Authors
Philipp Bräutigam
License
Copyright (c) 2016 Philipp Bräutigam
This repository is released under the GNU LGPL v3.0 license.