Browse Source

gii的model模板linyaomodel修改update.php字段,删除view.php编辑和删除按钮

wechat_public_accounts
linyao 5 years ago
parent
commit
8d17d68499
  1. 1
      vendor/linyao/generators/crud/default/views/_form.php
  2. 2
      vendor/linyao/generators/crud/default/views/update.php
  3. 8
      vendor/linyao/generators/crud/default/views/view.php

1
vendor/linyao/generators/crud/default/views/_form.php

@ -35,6 +35,7 @@ use yii\widgets\ActiveForm;
} ?> } ?>
<div class="form-group"> <div class="form-group">
<?= "<?= " ?>Html::submitButton(<?= $generator->generateString('保存') ?>, ['class' => 'btn btn-success']) ?> <?= "<?= " ?>Html::submitButton(<?= $generator->generateString('保存') ?>, ['class' => 'btn btn-success']) ?>
<?= "<?= " ?>Html::a(<?= $generator->generateString('返回') ?>, ['index'], ['class' => 'btn btn-info']) ?>
</div> </div>
<?= "<?php " ?>ActiveForm::end(); ?> <?= "<?php " ?>ActiveForm::end(); ?>

2
vendor/linyao/generators/crud/default/views/update.php

@ -9,7 +9,7 @@ use yii\helpers\StringHelper;
$urlParams = $generator->generateUrlParams(); $urlParams = $generator->generateUrlParams();
$modelClassName = Inflector::camel2words(StringHelper::basename($generator->modelClass)); $modelClassName = Inflector::camel2words(StringHelper::basename($generator->modelClass));
$nameAttributeTemplate = '$model->' . $generator->getNameAttribute(); $nameAttributeTemplate = '$model->' . $generator->getNameAttribute();
$titleTemplate = $generator->generateString('Update ' . $modelClassName . ': {name}', ['name' => '{nameAttribute}']);
$titleTemplate = $generator->generateString('编辑 ' . $modelClassName . ': {name}', ['name' => '{nameAttribute}']);
if ($generator->enableI18N) { if ($generator->enableI18N) {
$title = strtr($titleTemplate, ['\'{nameAttribute}\'' => $nameAttributeTemplate]); $title = strtr($titleTemplate, ['\'{nameAttribute}\'' => $nameAttributeTemplate]);
} else { } else {

8
vendor/linyao/generators/crud/default/views/view.php

@ -26,14 +26,6 @@ $this->params['breadcrumbs'][] = $this->title;
<p> <p>
<?= "<?= " ?>Html::a(<?= $generator->generateString('返回列表') ?>, ['index'], ['class' => 'btn btn-success']) ?> <?= "<?= " ?>Html::a(<?= $generator->generateString('返回列表') ?>, ['index'], ['class' => 'btn btn-success']) ?>
<?= "<?= " ?>Html::a(<?= $generator->generateString('编辑') ?>, ['update', <?= $urlParams ?>], ['class' => 'btn btn-primary']) ?>
<?= "<?= " ?>Html::a(<?= $generator->generateString('删除') ?>, ['delete', <?= $urlParams ?>], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => <?= $generator->generateString('确定要删除该条记录吗?') ?>,
'method' => 'post',
],
]) ?>
</p> </p>
<?= "<?= " ?>DetailView::widget([ <?= "<?= " ?>DetailView::widget([

Loading…
Cancel
Save