Advertisement
nazmiwafiy

view.php

Dec 6th, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 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 frontend\models\Contact */
  8.  
  9. $this->title = $model->name;
  10. $this->params['breadcrumbs'][] = ['label' => 'Contacts', 'url' => ['index']];
  11. $this->params['breadcrumbs'][] = $this->title;
  12. ?>
  13. <div class="contact-view">
  14.  
  15.     <h1><?= Html::encode($this->title) ?></h1>
  16.  
  17.     <p>
  18.         <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  19.         <?= Html::a('Delete', ['delete', 'id' => $model->id], [
  20.             'class' => 'btn btn-danger',
  21.             'data' => [
  22.                 'confirm' => 'Are you sure you want to delete this item?',
  23.                 'method' => 'post',
  24.             ],
  25.         ]) ?>
  26.     </p>
  27.  
  28.     <?= DetailView::widget([
  29.         'model' => $model,
  30.         'attributes' => [
  31.             'name',
  32.             'email:email',
  33.         ],
  34.     ]) ?>
  35.  
  36. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement