Регистр файлов

This commit is contained in:
origami11 2017-02-16 10:14:36 +03:00
parent 4fd0187ea6
commit c8958cbee0
83 changed files with 25 additions and 53 deletions

View file

@ -0,0 +1,27 @@
<?php
class Validator_Rule_Notnull extends Rule_Abstract
{
function skipEmpty() {
return false;
}
public function getErrorMsg()
{
return "Поле не должно быть пустым";
}
public function isValid(Collection $container, $status = null)
{
$data = $container->get($this->field);
if (is_array($data)) {
foreach($data as $c) {
if (trim($c) != '') return true;
}
return false;
} else {
$value = trim($data);
return $value != '';
}
}
}