Переделка для composer autoload
This commit is contained in:
parent
ad69746347
commit
b5641db607
100 changed files with 14 additions and 325 deletions
28
src/validator/rule/match.php
Normal file
28
src/validator/rule/match.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
require_once 'abstract.php';
|
||||
|
||||
/**
|
||||
* Проверка на равентство двух полей
|
||||
*/
|
||||
class Rule_Match extends Rule_Abstract
|
||||
{
|
||||
public $same;
|
||||
|
||||
public function getErrorMsg()
|
||||
{
|
||||
return "Поля не совпадают";
|
||||
}
|
||||
|
||||
/* public function __construct($field, $refField, $errorMsg)
|
||||
{
|
||||
$this->field = $field;
|
||||
$this->refField = $refField;
|
||||
$this->errorMsg = $errorMsg;
|
||||
}
|
||||
*/
|
||||
|
||||
public function isValid(Collection $container, $status = null) {
|
||||
return (strcmp($container->get($this->field), $container->get($this->same)) == 0);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue