<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<?php $form = ActiveForm::begin(['id' => 'test-form']); ?>
<?= $form->field($hostnames, 'test')->input('test')?>
<?= Html::submitButton('Submit') ?>
<?php ActiveForm::end(); ?>