form.php 891 Bytes
Newer Older
Qiang Xue committed
1 2
<?php
/**
Qiang Xue committed
3 4
 * This is the template for generating an action view file.
 *
Alexander Makarov committed
5
 * @var yii\web\View $this
Qiang Xue committed
6
 * @var yii\gii\generators\form\Generator $generator
Qiang Xue committed
7
 */
8 9

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

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

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

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

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

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

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

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