如何内联表单设计yii2?

时间:2016-06-29 07:41:34

标签: twitter-bootstrap yii2

如何在 yii2 中设计内联表单设计。实际上,我想在 yii2框架

中内联表单设计而不是构建表单设计

enter image description here

<?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'org_code')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'org_name')->textInput(['maxlength' => true]) ?>
 <?php ActiveForm::end(); ?>

1 个答案:

答案 0 :(得分:1)

试试这个: -

<?php $form = ActiveForm::begin(); ?>

<div class="row">
    <div class="col-sm-6">
        <?= $form->field($model ,'org_name')?>
    </div>
    <div class="col-sm-6">
        <?= $form->field($model ,'org_name')?>
    </div>
</div>

<div class="row">
    <div class="col-sm-4">
        <?= $form->field($model ,'org_name')?>
    </div>
</div>

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

阅读有关Bootstrap Grid

的更多信息