namespace app\models; 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'], ]; } // ... other methods ... }In this example, we are creating a contact form model that extends the yii\base\Model class. We define the attributes that will be used in the form as public properties inside this class. Then, we use the rules() method to define the validation rules for these attributes. This class belongs to the yii\base package library, which is a core component of the Yii framework.