for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace hiapi\validators;
use yii\validators\RegularExpressionValidator;
/**
* Class IdValidator validates an integer ID
*
* @author Dmytro Naumenko <[email protected]>
*/
class IdValidator extends RegularExpressionValidator
{
public $pattern = '/^\d+$/';
public function init()
parent::init();
$this->message = 'Value is not a valid numeric integer';
}