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.
35 lines
818 B
35 lines
818 B
<?php |
|
|
|
namespace core\forms; |
|
|
|
use Yii; |
|
use yii\base\Model; |
|
|
|
class ContactForm extends Model |
|
{ |
|
public ?string $name = null; |
|
public ?string $email = null; |
|
public ?string $subject = null; |
|
public ?string $body = null; |
|
public ?string $verifyCode = null; |
|
|
|
public function rules(): array |
|
{ |
|
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'), |
|
]; |
|
} |
|
}
|
|
|