Библиотека для cis, online, cms1
This commit is contained in:
commit
3c2e614d87
269 changed files with 39854 additions and 0 deletions
28
core/validator/rule/match.php
Normal file
28
core/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