_form.php 848 Bytes
<?php
    
    use common\modules\comment\models\Comment;
    use yii\helpers\Html;
    use yii\widgets\ActiveForm;
    
    /* @var $this yii\web\View */
    /* @var $model Comment */
    /* @var $form yii\widgets\ActiveForm */
    $status_list = [
        Comment::STATUS_ACTIVE  => 'Активный',
        Comment::STATUS_HIDDEN  => 'Новый',
        Comment::STATUS_DELETED => 'Удаленный',
    ]
?>

<div class="comment-form">
    
    <?php $form = ActiveForm::begin(); ?>
    
    <?= $form->field($model, 'text')
             ->textarea([ 'rows' => 6 ]) ?>
    
    <?= $form->field($model, 'status')
             ->dropDownList($status_list) ?>
    
    <div class="form-group">
        <?= Html::submitButton('Обновить', [ 'class' => 'btn btn-primary' ]) ?>
    </div>
    
    <?php ActiveForm::end(); ?>

</div>