PHP code example of erelke / hungarian-validator-bundle

1. Go to this page and download the library: Download erelke/hungarian-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/ */

    

erelke / hungarian-validator-bundle example snippets



namespace Acme\AcmeDemoBundle\Entity;

use Validator as HungarianAssert;

class AcmeEntity {
   #[HungarianAssert\PersonalId(message="Hibás személyi szám")]
  protected $personal_id;

  // ...
}


namespace Acme\AcmeDemoBundle\Entity;

use Validator as HungarianAssert;

class AcmeUser {

  protected \DateTimeInterface $birthDate 
  
  #[HungarianAssert\TaxId(message="Hibás adózanosító!",
   *    birthdayMessage="Adóazonosító nem a megadott születési dátumhoz ({{ birthDate }}) tartozik!",     
   *    birthdayProperty="birthDate")]
  protected ?string $taxId;

  protected \DateTime $birthDate;  
  // ...
}