form.php 855 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

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

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

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