Passed
Push — master ( 65662a...ffc20a )
by Wilmer
02:42
created

ContactForm::attributeLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace app\basic\forms;
4
5
use yii\base\Model;
6
7
/**
8
 * ContactForm is the model behind the contact form Web Application Basic.
9
 **/
10
class ContactForm extends Model
11
{
12
	public $name;
13
	public $email;
14
	public $subject;
15
	public $body;
16
	public $verifyCode;
17
18
	/**
19
     * rules
20
     *
21
	 * @return array the validation rules.
22
	 **/
23
	public function rules()
24
	{
25
		return [
26
			// name, email, subject and body are required
27
			[['name', 'email', 'subject', 'body'], 'required'],
28
			// email has to be a valid email address
29
			['email', 'email'],
30
			// verifyCode needs to be entered correctly
31
			//['verifyCode', \yii\captcha\CaptchaValidator::class],
32
		];
33
	}
34
}
35