Total Complexity | 1 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class ContactForm extends Model |
||
13 | { |
||
14 | public $name; |
||
15 | public $email; |
||
16 | public $subject; |
||
17 | public $body; |
||
18 | public $verifyCode; |
||
19 | |||
20 | /** |
||
21 | * rules. |
||
22 | * |
||
23 | * @return array the validation rules |
||
24 | **/ |
||
25 | public function rules(): array |
||
26 | { |
||
27 | return [ |
||
28 | // name, email, subject and body are required |
||
29 | [['name', 'email', 'subject', 'body'], 'required'], |
||
30 | // email has to be a valid email address |
||
31 | ['email', 'email'], |
||
32 | // verifyCode needs to be entered correctly |
||
37 |