choros/polish-extensions-bundle
最新稳定版本:0.3
Composer 安装命令:
composer require choros/polish-extensions-bundle
包简介
Symfony2 Bundle for Polish validators: NIP, REGON, PESEL
README 文档
README
Symfony2 Bundle for Polish validators: NIP, REGON, PESEL
It has validation translations for pl, en, de.
Installation
Bring in the vendor libraries
This can be done in two different ways:
Method #1) Use composer
"require": {
"php": ">=5.3.2",
"symfony/symfony": "2.1.*",
"_others": "your other packages",
"taveo/polish-extensions-bundle": "dev-master",
}
Method #2) Use git submodules
git submodule add git://github.com/taveo/TaveoPolishExtensionsBundle.git vendor/bundles/Taveo/PolishExtensionsBundle
Register the Taveo namespace
Only required, when using submodules.
// app/autoload.php
$loader->registerNamespaces(array(
'Taveo' => __DIR__.'/../vendor/bundles',
// your other namespaces
));
Add PolishExtensionsBundle to your application kernel
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Taveo\PolishExtensionsBundle\TaveoPolishExtensionsBundle(),
// ...
);
}
Examples
#1) Annotations
<?php // src/Acme/DemoBundle/Entity/AcmeEntity.php use Taveo\PolishExtensionsBundle\Validator\Constraints as TaveoAssert; class AcmeEntity { // ... /** * @TaveoAssert\NIP */ protected $nip; /** * @TaveoAssert\PESEL */ protected $pesel; /** * @TaveoAssert\REGON */ protected $regon; // ... }
#2) YAML
# src/Acme/DemoBundle/Resources/config/validation.yml Acme\DemoBundle\Entity\AcmeEntity: properties: nip: - Taveo\PolishExtensionsBundle\Validator\Constraints\NIP: ~ pesel: - Taveo\PolishExtensionsBundle\Validator\Constraints\PESEL: ~ regon: - Taveo\PolishExtensionsBundle\Validator\Constraints\REGON: ~
统计信息
- 总下载量: 83
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-15