trejjam / validation
验证IČ, RČ
v0.5
2015-08-06 16:27 UTC
Requires
- php: >=5.4
- edgedesign/ares: v0.1.1
- nette/nette: ~2.3
Requires (Dev)
- nette/tester: @dev
This package is auto-updated.
Last update: 2024-09-05 18:12:59 UTC
README
用户数据验证
- 离线IČ, RČ
- 在线IČ通过ARES,由Nette/Cache缓存
安装
安装Trejjam/Validation的最佳方式是使用Composer
$ composer require trejjam/validation:dev-master
配置
.neon
extensions: validation: Trejjam\Validation\DI\ValidationExtension validation: cache: use: true #disable cache name: ares #cache storage timeout: 60 minutes #cache expire debugger: true
使用方法
展示器
/** * @var \Trejjam\Validation @inject */ public $validation; function renderDefault() { //offline check $rcValid=$this->validation->rc("780123/3540"); //problematic RČ $icValid=$this->validation->ic("25596641"); //problematic IČ //online check $icValidOnline = $this->validation->aresIc("27604977"); //google IČ dump($rcValid); /* dump boolean TRUE */ dump($icValid); /* dump boolean TRUE */ dump($icValidOnline); /* dump stdClass ico => "27604977" (8) dic => "CZ27604977" (10) firma => "Google Czech Republic, s.r.o." (29) ulice => "Stroupežnického" (17) cisloOrientacni => "17" (2) cisloPopisne => "3191" (4) cisloMesto => "Praha" (5) castObce => "Smíchov" (8) psc => "15000" (5) */ }