field($model, 'name') ?> field($model, 'email') ?> field($model, 'message')->textarea(['rows' => 6]) ?>'btn btn-primary']) ?>
field($model, 'email', ['inputOptions' => ['class' => 'form-control']]) ?>
[['field1', 'field2'], 'required', 'when' => function ($model) { return $model->status == 'active'; }]This example shows how to validate multiple fields together using the ActiveForm widget and Yii's validation rules. The ActiveForm widget is part of the yii\widgets namespace in the yii2-widgets package library.