Take a look at ActiveField: https://github.com/yiisoft/yii2/blob/master/framework/widgets/ActiveField.php#L681