Advertisement
CalcioNit

user-view.php

Oct 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. <?php
  2.  
  3. use yii\helpers\Html;
  4. use yii\widgets\DetailView;
  5.  
  6. /* @var $this yii\web\View */
  7. /* @var $model common\models\User */
  8.  
  9. $this->title = $model->username;
  10. $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Users'), 'url' => ['index']];
  11. $this->params['breadcrumbs'][] = $this->title;
  12. \yii\web\YiiAsset::register($this);
  13. ?>
  14. <div class="user-view">
  15.     <p>
  16.         <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  17.         <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
  18.             'class' => 'btn btn-danger',
  19.             'data' => [
  20.                 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
  21.                 'method' => 'post',
  22.             ],
  23.         ]) ?>
  24.         <?= Html::a(Yii::t('app', 'Change Password'), ['change-password', 'id' => $model->id], [
  25.             'class' => 'btn btn-warning',
  26.             'data' => [
  27.                 'confirm' => Yii::t('app', 'Are you sure you want to change the password?'),
  28.             ],
  29.         ]) ?>
  30.     </p>
  31.  
  32.     <?= DetailView::widget([
  33.         'model' => $model,
  34.         'template' => '<tr><th{captionOptions} class="col-sm-2">{label}</th><td{contentOptions}>{value}</td></tr>',
  35.         'attributes' => [
  36.             'id',
  37.             'username',
  38.             'email:email',
  39.             'status:userStatus',
  40.             'created_at:dateTime',
  41.             'updated_at:dateTime',
  42.         ],
  43.     ]) ?>
  44.  
  45. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement