Conditions | 1 |
Paths | 1 |
Total Lines | 36 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function __construct() |
||
11 | { |
||
12 | Validator::add($this, function(Rules $rules){ |
||
13 | $rules->action('login') |
||
14 | ->field( |
||
15 | 'field_email', |
||
16 | ['minlength' => 1, 'filter' => FILTER_VALIDATE_EMAIL, 'regex' => '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/', 'required' => true], |
||
17 | 'Email address' |
||
18 | ) |
||
19 | ->field( |
||
20 | 'field_password', |
||
21 | ['minlength' => 6, 'maxlength' => 20, 'required' => true], |
||
22 | 'Password' |
||
23 | ) |
||
24 | ->field( |
||
25 | 'field_password2', |
||
26 | ['minlength' => 6, 'maxlength' => 20, 'equals' => 'field_password', 'required' => true], |
||
27 | 'Confirm password' |
||
28 | ) |
||
29 | ->field( |
||
30 | 'field_remember', |
||
31 | ['minlength' => 2, 'maxlength' => 2, 'required' => false], |
||
32 | 'Keep connected' |
||
33 | ) |
||
34 | ->field( |
||
35 | 'field_birth', |
||
36 | ['type' => 'date', 'required' => true], |
||
37 | 'Date of birth' |
||
38 | ) |
||
39 | ->field( |
||
40 | 'field_phones', |
||
41 | ['mincount' => 2, 'maxcount' => 3, 'required' => true, 'minlength' => 8, 'maxlength' => 9], |
||
42 | 'Phones' |
||
43 | ); |
||
44 | |||
45 | return $rules; |
||
46 | }); |
||
50 |