dev-master
9999999-dev https://github.com/tuxone/ValidationBundleValidators for Symfony2
MIT
The Requires
The Development Requires
validation words bad
Validators for Symfony2
Right now this Symfony2 bundle includes only bad words validation based on blacklists. The english blacklist provided comes from here., (*2)
Use Composer to install: tuxone/validation-bundle
., (*3)
In your composer.json
you should have:, (*4)
yaml
{
"require": {
"tuxone/validation-bundle": "dev-master"
}
}
, (*5)
tux_one_validation: dictionary_file_path: /path/to/custom/dictionary.txt
"dictionary.txt" is a custom dictionary that contains a list of bad word. This configuration is optionally. If setted, the bundle works with your custom bad word list, otherwise it will work with the default bad word list., (*6)
If TuxOneValidationBundle has been added to the project, its validators can be used just like every other Symfony2 validator., (*7)
# src/Acme/DemoBundle/Resources/config/validation.yml Acme\DemoBundle\Entity\AcmeMessage: properties: text: - TuxOne\ValidationBundle\Validator\Constraints\NotContainsBadWords: ~
// src/Acme/DemoBundle/Entity/AcmeMessage.php use Symfony\Component\Validator\Constraints as Assert; use TuxOne\ValidationBundle\Validator\Constraints as TuxOneAssert; class AcmeEntity { // ... /** * @Assert\NotBlank * @TuxOneAssert\NotContainsBadWords() */ protected $text; // ... }
Copyright (c) 2013 Alessandro Loffredo, (*8)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*9)
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*10)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*11)
Validators for Symfony2
MIT
validation words bad