You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
736 B
36 lines
736 B
7 years ago
|
<?php
|
||
|
|
||
|
namespace core\forms;
|
||
|
|
||
|
use Yii;
|
||
|
use yii\base\Model;
|
||
|
|
||
|
class ContactForm extends Model
|
||
|
{
|
||
|
public $name;
|
||
|
public $email;
|
||
|
public $subject;
|
||
|
public $body;
|
||
|
public $verifyCode;
|
||
|
|
||
|
public function rules()
|
||
|
{
|
||
|
return [
|
||
|
[['name', 'email', 'subject', 'body'], 'required'],
|
||
|
['email', 'email'],
|
||
|
['verifyCode', 'captcha'],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function attributeLabels()
|
||
|
{
|
||
|
return [
|
||
|
'verifyCode' => Yii::t('main', 'Verification Code'),
|
||
|
'name' => Yii::t('main', 'Your name'),
|
||
|
'subject' => Yii::t('main', 'Subject'),
|
||
|
'message' => Yii::t('main', 'Message'),
|
||
|
'email' => Yii::t('main', 'E-mail'),
|
||
|
];
|
||
|
}
|
||
|
}
|