<?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'), ]; } }