update.php 1.04 KB
Newer Older
Qiang Xue committed
1
<?php
Qiang Xue committed
2 3 4 5

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

Qiang Xue committed
6
/**
Alexander Makarov committed
7
 * @var yii\web\View $this
Qiang Xue committed
8
 * @var yii\gii\generators\crud\Generator $generator
Qiang Xue committed
9 10
 */

Qiang Xue committed
11 12
$urlParams = $generator->generateUrlParams();

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

Qiang Xue committed
16 17 18
use yii\helpers\Html;

/**
Alexander Makarov committed
19
 * @var yii\web\View $this
Alexander Makarov committed
20
 * @var <?= ltrim($generator->modelClass, '\\') ?> $model
Qiang Xue committed
21
 */
Qiang Xue committed
22

Alexander Makarov committed
23 24 25
$this->title = 'Update <?= Inflector::camel2words(StringHelper::basename($generator->modelClass)) ?>: ' . $model-><?= $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => '<?= Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model-><?= $generator->getNameAttribute() ?>, 'url' => ['view', <?= $urlParams ?>]];
Qiang Xue committed
26
$this->params['breadcrumbs'][] = 'Update';
Qiang Xue committed
27
?>
Alexander Makarov committed
28
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-update">
Qiang Xue committed
29

30
	<h1><?= "<?= " ?>Html::encode($this->title) ?></h1>
Qiang Xue committed
31

Qiang Xue committed
32
	<?= "<?= " ?>$this->render('_form', [
Qiang Xue committed
33
		'model' => $model,
Qiang Xue committed
34
	]) ?>
Qiang Xue committed
35

Qiang Xue committed
36
</div>