src/Validators/CheckRequired.php 1 location
|
@@ 29-37 (lines=9) @@
|
26 |
|
$this->error = $error; |
27 |
|
} |
28 |
|
|
29 |
|
public function validate(FieldInterface $field, InputModel $model, InputValidation $validation) |
30 |
|
{ |
31 |
|
if ($model->getInput($field) === null) { |
32 |
|
$model->setError( |
33 |
|
$field, |
34 |
|
$this->error ?: lang::text("mindplay/kissform", "required", ["field" => $validation->getLabel($field)]) |
35 |
|
); |
36 |
|
} |
37 |
|
} |
38 |
|
} |
39 |
|
|
src/Validators/CheckSameValue.php 1 location
|
@@ 43-51 (lines=9) @@
|
40 |
|
$this->error = $error; |
41 |
|
} |
42 |
|
|
43 |
|
public function validate(FieldInterface $field, InputModel $model, InputValidation $validation) |
44 |
|
{ |
45 |
|
if ($model->getInput($field) !== $model->getInput($this->primary_field)) { |
46 |
|
$model->setError( |
47 |
|
$field, |
48 |
|
$this->error ?: lang::text("mindplay/kissform", "confirm", ["field" => $validation->getLabel($field)]) |
49 |
|
); |
50 |
|
} |
51 |
|
} |
52 |
|
} |
53 |
|
|