| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class ContactForm extends Model |
||
| 12 | { |
||
| 13 | public $name; |
||
| 14 | public $email; |
||
| 15 | public $subject; |
||
| 16 | public $body; |
||
| 17 | public $verifyCode; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * rules |
||
| 21 | * |
||
| 22 | * @return array the validation rules. |
||
| 23 | **/ |
||
| 24 | public function rules() |
||
| 25 | { |
||
| 26 | return [ |
||
| 27 | // name, email, subject and body are required |
||
| 28 | [['name', 'email', 'subject', 'body'], 'required'], |
||
| 29 | // email has to be a valid email address |
||
| 30 | ['email', 'email'], |
||
| 31 | // verifyCode needs to be entered correctly |
||
| 32 | //['verifyCode', \yii\captcha\CaptchaValidator::class], |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * attributeLabels |
||
| 38 | * Translate Atribute Labels. |
||
| 39 | * |
||
| 40 | * @return array customized attribute labels. |
||
| 41 | **/ |
||
| 42 | public function attributeLabels() |
||
| 51 | ]; |
||
| 52 | } |
||
| 54 |