like this in my model I have required fields
public function rules() { return [ [['user_id', 'city_id', 'payment',], 'required'], ['street', 'required', 'message' => 'Укажите название улицы.'], ... } this way I organize the work with the form
<div class="col-xs-12 col-sm-4"> <div class="form-group"> <?= Html::activeLabel($model,'street'); ?> <?= Html::activeInput('text',$model,'street',['class'=>'form-control']) ?> </div> </div> Actually, the whole question is how you can mark the required fields when using activeinput , given that these fields are mandatory in the model. Use Activeform is not possible