You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.4 KiB
54 lines
1.4 KiB
11 years ago
|
<?php
|
||
11 years ago
|
|
||
|
use yii\helpers\Inflector;
|
||
|
use yii\helpers\StringHelper;
|
||
|
|
||
11 years ago
|
/**
|
||
11 years ago
|
* @var yii\base\View $this
|
||
|
* @var yii\gii\generators\crud\Generator $generator
|
||
11 years ago
|
*/
|
||
|
|
||
11 years ago
|
$urlParams = $generator->generateUrlParams();
|
||
11 years ago
|
|
||
11 years ago
|
echo "<?php\n";
|
||
11 years ago
|
?>
|
||
|
|
||
11 years ago
|
use yii\helpers\Html;
|
||
11 years ago
|
use yii\widgets\DetailView;
|
||
11 years ago
|
|
||
11 years ago
|
/**
|
||
11 years ago
|
* @var yii\base\View $this
|
||
11 years ago
|
* @var <?= ltrim($generator->modelClass, '\\') ?> $model
|
||
11 years ago
|
*/
|
||
11 years ago
|
|
||
11 years ago
|
$this->title = $model-><?= $generator->getNameAttribute() ?>;
|
||
|
$this->params['breadcrumbs'][] = ['label' => '<?= Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>', 'url' => ['index']];
|
||
11 years ago
|
$this->params['breadcrumbs'][] = $this->title;
|
||
11 years ago
|
?>
|
||
11 years ago
|
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-view">
|
||
11 years ago
|
|
||
11 years ago
|
<h1><?= "<?= " ?>Html::encode($this->title) ?></h1>
|
||
11 years ago
|
|
||
11 years ago
|
<p>
|
||
11 years ago
|
<?= "<?= " ?>Html::a('Update', ['update', <?= $urlParams ?>], ['class' => 'btn btn-primary']) ?>
|
||
|
<?= "<?php " ?>echo Html::a('Delete', ['delete', <?= $urlParams ?>], [
|
||
11 years ago
|
'class' => 'btn btn-danger',
|
||
|
'data-confirm' => Yii::t('app', 'Are you sure to delete this item?'),
|
||
|
'data-method' => 'post',
|
||
11 years ago
|
]); ?>
|
||
11 years ago
|
</p>
|
||
11 years ago
|
|
||
11 years ago
|
<?= "<?php " ?>echo DetailView::widget([
|
||
11 years ago
|
'model' => $model,
|
||
11 years ago
|
'attributes' => [
|
||
11 years ago
|
<?php
|
||
11 years ago
|
foreach ($generator->getTableSchema()->columns as $column) {
|
||
11 years ago
|
$format = $generator->generateColumnFormat($column);
|
||
11 years ago
|
echo "\t\t\t'" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
|
||
11 years ago
|
}
|
||
|
?>
|
||
11 years ago
|
],
|
||
|
]); ?>
|
||
11 years ago
|
|
||
11 years ago
|
</div>
|