Skip to content

Instantly share code, notes, and snippets.

@calcio
Created May 22, 2021 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calcio/77e8c1492d2b13cd233d5edcfa0d030f to your computer and use it in GitHub Desktop.
Save calcio/77e8c1492d2b13cd233d5edcfa0d030f to your computer and use it in GitHub Desktop.
vitrine\modules\admin\views\view.php
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\User */
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Users'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">
<h1>Usuário: <?= 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',
'username',
'email:email',
'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