form.php 931 Bytes
Newer Older
Qiang Xue committed
1 2
<?php
/**
Qiang Xue committed
3
 * This is the template for generating an action view file.
Qiang Xue committed
4
 */
5

6 7 8
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\form\Generator */

9
echo "<?php\n";
Qiang Xue committed
10 11 12 13 14
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

15 16 17
/* @var $this yii\web\View */
/* @var $model <?= $generator->modelClass ?> */
/* @var $form ActiveForm */
Alexander Makarov committed
18
<?= "?>" ?>
Qiang Xue committed
19

Alexander Makarov committed
20
<div class="<?= str_replace('/', '-', trim($generator->viewName, '_')) ?>">
Qiang Xue committed
21

22
    <?= "<?php " ?>$form = ActiveForm::begin(); ?>
Qiang Xue committed
23

24 25 26
    <?php foreach ($generator->getModelAttributes() as $attribute): ?>
    <?= "<?= " ?>$form->field($model, '<?= $attribute ?>') ?>
    <?php endforeach; ?>
Qiang Xue committed
27

28
        <div class="form-group">
29
            <?= "<?= " ?>Html::submitButton(<?= $generator->generateString('Submit') ?>, ['class' => 'btn btn-primary']) ?>
30 31
        </div>
    <?= "<?php " ?>ActiveForm::end(); ?>
Qiang Xue committed
32

Alexander Makarov committed
33
</div><!-- <?= str_replace('/', '-', trim($generator->viewName, '-')) ?> -->