<?php

use common\modules\attachment\widgets\SingleWidget;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Voice */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="box box-success">
    <div class="box-body">
        <?php $form = ActiveForm::begin(); ?>

        <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
        <?= $form->field($model, 'file')->hint('限制mp3格式音频文件')->widget(SingleWidget::className(), ['acceptFileTypes' => 'audio/mpeg', 'onlyImage' => false]) ?>
        <?= $form->field($model, 'is_default')->radioList(\common\enums\StatusEnum::$list) ?>


        <div class="form-group">
            <?= Html::submitButton($model->isNewRecord ? Yii::t('common', 'Create') : Yii::t('common', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success btn-flat' : 'btn btn-primary btn-flat']) ?>
        </div>

        <?php ActiveForm::end(); ?>
    </div>
</div>
