示例#1
0
文件: default.php 项目: tolik505/bl
    }
    ?>
        <?php 
}
?>
        </li>
    </ol>

    <!-- Start Respond Form -->
    <div id="respond">
        <h2 class="respond-title"><?php 
echo Yii::t('app', 'Leave a reply');
?>
</h2>
        <?php 
$form = \yii\widgets\ActiveForm::begin(['action' => \common\models\Comment::getAddCommentUrl(), 'options' => ['id' => 'comment-form', 'class' => 'ajax-form']]);
echo \yii\helpers\Html::hiddenInput('parent_id', 0, ['class' => 'parent_id']);
echo $form->field($commentModel, 'model_name')->hiddenInput(['value' => $model->formName()]);
echo $form->field($commentModel, 'model_id')->hiddenInput(['value' => $model->id]);
if (Yii::$app->user->isGuest) {
    ?>
        <div class="row">
            <div class="col-md-4">
                <?php 
    echo $form->field($commentModel, 'name')->textInput(['size' => 30, 'aria-required' => true]);
    ?>
            </div>
        </div>
        <?php 
} else {
    echo $form->field($commentModel, 'user_id')->hiddenInput(['value' => Yii::$app->user->id]);