PHP code example of adamaru / polish-validator-bundle
1. Go to this page and download the library: Download adamaru/polish-validator-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adamaru / polish-validator-bundle example snippets
public function registerBundles()
{
$bundles = array(
...
new Kiczort\PolishValidatorBundle\KiczortPolishValidatorBundle(),
...
);
return $bundles;
}
...
// src/AppBundle/Entity/Person.php
namespace AppBundle\Entity;
use Kiczort\PolishValidatorBundle\Validator\Constraints as KiczortAssert;
class Person
{
/**
* @KiczortAssert\Pesel(
* message = "The '{{ value }}' is not a valid PESEL number.",
* strict = true
* )
*/
protected $pesel;
}
...
// src/AppBundle/Entity/Person.php
namespace AppBundle\Entity;
use Kiczort\PolishValidatorBundle\Validator\Constraints as KiczortAssert;
class Person
{
/**
* @KiczortAssert\Nip
*/
protected $nip;
}
...
// src/AppBundle/Entity/Company.php
namespace AppBundle\Entity;
use Kiczort\PolishValidatorBundle\Validator\Constraints as KiczortAssert;
class Company
{
/**
* @KiczortAssert\Regon
*/
protected $regon;
}
...
// src/AppBundle/Entity/Company.php
namespace AppBundle\Entity;
use Kiczort\PolishValidatorBundle\Validator\Constraints as KiczortAssert;
class Doctor
{
/**
* @KiczortAssert\Pwz
*/
protected $pwz;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.