Created
March 26, 2018 03:31
-
-
Save calcio/c3b5e5d3c8d274fab36ef0047e21fe29 to your computer and use it in GitHub Desktop.
DetailView::widget() - arquivo view.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use yii\helpers\Html; | |
use yii\widgets\DetailView; | |
/* @var $this yii\web\View */ | |
/* @var $model app\modules\admin\models\Category */ | |
$this->title = $model->name; | |
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Categories'), 'url' => ['index']]; | |
$this->params['breadcrumbs'][] = $this->title; | |
?> | |
<div class="category-view"> | |
<h1><?= Yii::t('app', 'Category') ?>: <?= Html::encode($this->title) ?></h1> | |
<p> | |
<?= Html::a('Novo', ['create'], ['class' => 'btn btn-success']) ?> | |
<?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | |
<?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | |
'class' => 'btn btn-danger', | |
'data' => [ | |
'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | |
'method' => 'post', | |
], | |
]) ?> | |
</p> | |
<?= DetailView::widget([ | |
'model' => $model, | |
'template' => '<tr><th{captionOptions} class="col-sm-2">{label}</th><td{contentOptions}>{value}</td></tr>', | |
'attributes' => [ | |
'id', | |
'name', | |
'status:status', | |
'created_at:date', | |
'updated_at:date', | |
], | |
]) ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment