Commit e79a45777ff21c243b44f9ca5a77928e2b9aa0cc

Authored by Alexey Boroda
2 parents bb962a6d fbfae870

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	models/Order.php
controllers/OrderPaymentController.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +namespace artweb\artbox\ecommerce\controllers;
  4 +
  5 +use Yii;
  6 +use artweb\artbox\ecommerce\models\OrderPayment;
  7 +use artweb\artbox\ecommerce\models\OrderPaymentSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +
  12 +/**
  13 + * OrderPaymentController implements the CRUD actions for OrderPayment model.
  14 + */
  15 +class OrderPaymentController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'verbs' => [
  24 + 'class' => VerbFilter::className(),
  25 + 'actions' => [
  26 + 'delete' => ['POST'],
  27 + ],
  28 + ],
  29 + ];
  30 + }
  31 +
  32 + /**
  33 + * Lists all OrderPayment models.
  34 + * @return mixed
  35 + */
  36 + public function actionIndex()
  37 + {
  38 + $searchModel = new OrderPaymentSearch();
  39 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  40 +
  41 + return $this->render('index', [
  42 + 'searchModel' => $searchModel,
  43 + 'dataProvider' => $dataProvider,
  44 + ]);
  45 + }
  46 +
  47 + /**
  48 + * Displays a single OrderPayment model.
  49 + * @param integer $id
  50 + * @return mixed
  51 + */
  52 + public function actionView($id)
  53 + {
  54 + return $this->render('view', [
  55 + 'model' => $this->findModel($id),
  56 + ]);
  57 + }
  58 +
  59 + /**
  60 + * Creates a new OrderPayment model.
  61 + * If creation is successful, the browser will be redirected to the 'view' page.
  62 + * @return mixed
  63 + */
  64 + public function actionCreate()
  65 + {
  66 + $model = new OrderPayment();
  67 + $model->generateLangs();
  68 + if ($model->load(Yii::$app->request->post())) {
  69 + $model->loadLangs(\Yii::$app->request);
  70 + if ($model->save() && $model->transactionStatus) {
  71 + return $this->redirect([
  72 + 'view',
  73 + 'id' => $model->id,
  74 + ]);
  75 + }
  76 +
  77 + }
  78 +
  79 + return $this->render('create', [
  80 + 'model' => $model,
  81 + 'modelLangs' => $model->modelLangs,
  82 + ]);
  83 + }
  84 +
  85 + /**
  86 + * Updates an existing OrderPayment model.
  87 + * If update is successful, the browser will be redirected to the 'view' page.
  88 + * @param integer $id
  89 + * @return mixed
  90 + */
  91 + public function actionUpdate($id)
  92 + {
  93 + $model = $this->findModel($id);
  94 + $model->generateLangs();
  95 + if ($model->load(Yii::$app->request->post())) {
  96 + $model->loadLangs(\Yii::$app->request);
  97 + if ($model->save() && $model->transactionStatus) {
  98 +
  99 + return $this->redirect([
  100 + 'view',
  101 + 'id' => $model->id,
  102 + ]);
  103 + }
  104 + }
  105 +
  106 + return $this->render('update', [
  107 + 'model' => $model,
  108 + 'modelLangs' => $model->modelLangs,
  109 + ]);
  110 + }
  111 +
  112 + /**
  113 + * Deletes an existing OrderPayment model.
  114 + * If deletion is successful, the browser will be redirected to the 'index' page.
  115 + * @param integer $id
  116 + * @return mixed
  117 + */
  118 + public function actionDelete($id)
  119 + {
  120 + $this->findModel($id)->delete();
  121 +
  122 + return $this->redirect(['index']);
  123 + }
  124 +
  125 + /**
  126 + * Finds the OrderPayment model based on its primary key value.
  127 + * If the model is not found, a 404 HTTP exception will be thrown.
  128 + * @param integer $id
  129 + * @return OrderPayment the loaded model
  130 + * @throws NotFoundHttpException if the model cannot be found
  131 + */
  132 + protected function findModel($id)
  133 + {
  134 + if (($model = OrderPayment::findOne($id)) !== null) {
  135 + return $model;
  136 + } else {
  137 + throw new NotFoundHttpException('The requested page does not exist.');
  138 + }
  139 + }
  140 +}
... ...
models/Order.php
... ... @@ -40,26 +40,10 @@
40 40 * @property double $amount_imposed
41 41 * @property string $shipping_by
42 42 * @property string $city
  43 + * @property string $deliveryString
43 44 */
44 45 class Order extends ActiveRecord
45 46 {
46   - const PAYMENT_LIST = [
47   - 1 => [
48   - 'label' => 'ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐะปะธั‡ะฝั‹ะผะธ',
49   - ],
50   - 2 => [
51   - 'label' => 'ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐ ะบะฐั€ั‚ัƒ ะŸั€ะธะฒะฐั‚ ะ‘ะฐะฝะบะฐ',
52   - 'hint' => 'ะพะฟะปะฐั‚ะฐ ะฟะพัั‚ัƒะฟะฐะตั‚ 30 ะผะธะฝัƒั‚ ะดะพ ััƒั‚ะพะบ!',
53   - ],
54   - 3 => [
55   - 'label' => 'ะžะฟะปะฐั‚ะธั‚ัŒ "ะŸั€ะฐะฒะตะบั-ั‚ะตะปะตะณั€ะฐั„"',
56   - 'hint' => 'ะพะฟะปะฐั‚ะฐ ะดะตะฝะตะถะฝั‹ะผ ะฟะตั€ะตะฒะพะดะพะผ ะฟะพัั‚ัƒะฟะฐะตั‚ ะพั‚ 30 ะผะธะฝ. ะดะพ 4 ั‡ะฐัะพะฒ',
57   - ],
58   - 4 => [
59   - 'label' => 'ะžะฟะปะฐั‚ะธั‚ัŒ ะฟะพ ะฑะตะทะฝะฐะปะธั‡ะฝะพะผัƒ ั€ะฐัั‡ะตั‚ัƒ',
60   - 'hint' => 'ะพะฟะปะฐั‚ะฐ ะฟะพัั‚ัƒะฟะฐะตั‚ ะฝะฐ ัั‡ะตั‚ ะพั‚ 1 ะดะพ 3 ั€ะฐะฑะพั‡ะธั… ะดะฝะตะน! ะกั‡ะตั‚ ะฝะฐ ะพะฟะปะฐั‚ัƒ ะพั‚ะฟั€ะฐะฒะธะผ ัั€ะฐะทัƒ ะฟะพัะปะต ะพะฑั€ะฐะฑะพั‚ะบะธ ะทะฐะบะฐะทะฐะฝะฐ ะฝะฐ ะฒะฐัˆ e-mail',
61   - ],
62   - ];
63 47  
64 48 const SHIPPING_BY = [
65 49 1 => [
... ... @@ -140,16 +124,6 @@
140 124 'string',
141 125 'max' => 255,
142 126 ],
143   - [
144   - [ 'payment' ],
145   - 'in',
146   - 'range' => [
147   - 1,
148   - 2,
149   - 3,
150   - 4,
151   - ],
152   - ],
153 127 ];
154 128 }
155 129  
... ... @@ -170,9 +144,54 @@
170 144 {
171 145 return $this->hasOne(Customer::className(), [ 'id' => 'user_id' ]);
172 146 }
173   -
  147 +
  148 + /**
  149 + * @return \yii\db\ActiveQuery
  150 + */
174 151 public function getProducts()
175 152 {
176 153 return $this->hasMany(OrderProduct::className(), [ 'order_id' => 'id' ]);
177 154 }
  155 +
  156 +
  157 + /**
  158 + * @return \yii\db\ActiveQuery
  159 + */
  160 + public function getOrderDelivery(){
  161 + return $this->hasOne(Delivery::className(), ['id'=> 'delivery']);
  162 + }
  163 +
  164 + /**
  165 + * @return \yii\db\ActiveQuery
  166 + */
  167 + public function getOrderLabel(){
  168 + return $this->hasOne(Label::className(),['id'=> 'status']);
  169 + }
  170 +
  171 +
  172 +
  173 + /**
  174 + * @return \yii\db\ActiveQuery
  175 + */
  176 + public function getOrderPayment(){
  177 + return $this->hasOne(OrderPayment::className(),['id'=> 'payment']);
  178 + }
  179 +
  180 +
  181 + /**
  182 + * @return string
  183 + */
  184 + public function getDeliveryString(){
  185 + if(!empty($this->orderDelivery)){
  186 + if(!empty($this->orderDelivery->parent)){
  187 + return $this->orderDelivery->parent->lang->title .': '.$this->orderDelivery->lang->title;
  188 + } else {
  189 + return $this->orderDelivery->lang->title;
  190 + }
  191 + } else {
  192 + return '';
  193 + }
  194 + }
  195 +
  196 +
178 197 }
179 198 \ No newline at end of file
... ...
models/OrderPayment.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +namespace artweb\artbox\ecommerce\models;
  4 +
  5 +use artweb\artbox\language\behaviors\LanguageBehavior;
  6 +use Yii;
  7 +use yii\db\ActiveQuery;
  8 +use yii\db\ActiveRecord;
  9 +use yii\web\Request;
  10 +/**
  11 + * This is the model class for table "order_payment".
  12 + *
  13 + * @property integer $id
  14 + * @property integer $status
  15 + *
  16 + * @property OrderPaymentLang[] $orderPaymentLangs
  17 + *
  18 + * * From language behavior *
  19 + * @property orderPaymentLang $lang
  20 + * @property orderPaymentLang[] $langs
  21 + * @property orderPaymentLang $objectLang
  22 + * @property string $ownerKey
  23 + * @property string $langKey
  24 + * @property orderPaymentLang[] $modelLangs
  25 + * @property bool $transactionStatus
  26 + * @method string getOwnerKey()
  27 + * @method void setOwnerKey( string $value )
  28 + * @method string getLangKey()
  29 + * @method void setLangKey( string $value )
  30 + * @method ActiveQuery getLangs()
  31 + * @method ActiveQuery getLang( integer $language_id )
  32 + * @method OrderPaymentLang[] generateLangs()
  33 + * @method void loadLangs( Request $request )
  34 + * @method bool linkLangs()
  35 + * @method bool saveLangs()
  36 + * @method bool getTransactionStatus()
  37 + * * End language behavior
  38 + */
  39 +class OrderPayment extends \yii\db\ActiveRecord
  40 +{
  41 +
  42 +
  43 + const ACTIVE = 1;
  44 + const INACTIVE = 2;
  45 + /**
  46 + * @inheritdoc
  47 + */
  48 + public static function tableName()
  49 + {
  50 + return 'order_payment';
  51 + }
  52 +
  53 +
  54 + public function behaviors()
  55 + {
  56 + return [
  57 + 'language' => [
  58 + 'class' => LanguageBehavior::className(),
  59 + 'objectLang' => OrderPaymentLang::className(),
  60 + 'ownerKey' => 'id',
  61 + 'langKey' => 'order_payment_id',
  62 + ],
  63 + ];
  64 + }
  65 +
  66 + /**
  67 + * @inheritdoc
  68 + */
  69 + public function rules()
  70 + {
  71 + return [
  72 + [['status'], 'integer'],
  73 + [
  74 + [ 'status' ],
  75 + 'default',
  76 + 'value' => 1,
  77 + ],
  78 + ];
  79 + }
  80 +
  81 + /**
  82 + * @inheritdoc
  83 + */
  84 + public function attributeLabels()
  85 + {
  86 + return [
  87 + 'id' => \Yii::t('app','ID'),
  88 + 'status' => \Yii::t('app','ะกั‚ะฐั‚ัƒั'),
  89 + ];
  90 + }
  91 +
  92 + /**
  93 + * @return \yii\db\ActiveQuery
  94 + */
  95 + public function getOrderPaymentLangs()
  96 + {
  97 + return $this->hasMany(OrderPaymentLang::className(), ['order_payment_id' => 'id']);
  98 + }
  99 +}
... ...
models/OrderPaymentLang.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +namespace artweb\artbox\ecommerce\models;
  4 +
  5 +use artweb\artbox\language\models\Language;
  6 +use Yii;
  7 +
  8 +/**
  9 + * This is the model class for table "order_payment_lang".
  10 + *
  11 + * @property integer $id
  12 + * @property integer $order_payment_id
  13 + * @property integer $language_id
  14 + * @property string $title
  15 + * @property string $text
  16 + *
  17 + * @property Language $language
  18 + * @property OrderPayment $orderPayment
  19 + */
  20 +class OrderPaymentLang extends \yii\db\ActiveRecord
  21 +{
  22 + /**
  23 + * @inheritdoc
  24 + */
  25 + public static function tableName()
  26 + {
  27 + return 'order_payment_lang';
  28 + }
  29 +
  30 + /**
  31 + * @inheritdoc
  32 + */
  33 + public function rules()
  34 + {
  35 + return [
  36 + [['order_payment_id', 'language_id', 'title'], 'required'],
  37 + [['order_payment_id', 'language_id'], 'integer'],
  38 + [['text'], 'string'],
  39 + [['title'], 'string', 'max' => 255],
  40 + [['language_id'], 'exist', 'skipOnError' => true, 'targetClass' => Language::className(), 'targetAttribute' => ['language_id' => 'id']],
  41 + [['order_payment_id'], 'exist', 'skipOnError' => true, 'targetClass' => OrderPayment::className(), 'targetAttribute' => ['order_payment_id' => 'id']],
  42 + ];
  43 + }
  44 +
  45 + /**
  46 + * @inheritdoc
  47 + */
  48 + public function attributeLabels()
  49 + {
  50 + return [
  51 + 'id' => 'ID',
  52 + 'order_payment_id' => 'Order Payment ID',
  53 + 'language_id' => 'Language ID',
  54 + 'title' => 'Title',
  55 + 'text' => 'Text',
  56 + ];
  57 + }
  58 +
  59 + /**
  60 + * @return \yii\db\ActiveQuery
  61 + */
  62 + public function getLanguage()
  63 + {
  64 + return $this->hasOne(Language::className(), ['id' => 'language_id']);
  65 + }
  66 +
  67 + /**
  68 + * @return \yii\db\ActiveQuery
  69 + */
  70 + public function getOrderPayment()
  71 + {
  72 + return $this->hasOne(OrderPayment::className(), ['id' => 'order_payment_id']);
  73 + }
  74 +}
... ...
models/OrderPaymentSearch.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +namespace artweb\artbox\ecommerce\models;
  4 +
  5 +use Yii;
  6 +use yii\base\Model;
  7 +use yii\data\ActiveDataProvider;
  8 +use artweb\artbox\ecommerce\models\OrderPayment;
  9 +
  10 +/**
  11 + * OrderPaymentSearch represents the model behind the search form about `artweb\artbox\ecommerce\models\OrderPayment`.
  12 + */
  13 +class OrderPaymentSearch extends OrderPayment
  14 +{
  15 + /**
  16 + * @inheritdoc
  17 + */
  18 + public function rules()
  19 + {
  20 + return [
  21 + [['id'], 'integer'],
  22 + ];
  23 + }
  24 +
  25 + /**
  26 + * @inheritdoc
  27 + */
  28 + public function scenarios()
  29 + {
  30 + // bypass scenarios() implementation in the parent class
  31 + return Model::scenarios();
  32 + }
  33 +
  34 + /**
  35 + * Creates data provider instance with search query applied
  36 + *
  37 + * @param array $params
  38 + *
  39 + * @return ActiveDataProvider
  40 + */
  41 + public function search($params)
  42 + {
  43 + $query = OrderPayment::find();
  44 +
  45 + // add conditions that should always apply here
  46 +
  47 + $dataProvider = new ActiveDataProvider([
  48 + 'query' => $query,
  49 + ]);
  50 +
  51 + $this->load($params);
  52 +
  53 + if (!$this->validate()) {
  54 + // uncomment the following line if you do not want to return any records when validation fails
  55 + // $query->where('0=1');
  56 + return $dataProvider;
  57 + }
  58 +
  59 + // grid filtering conditions
  60 + $query->andFilterWhere([
  61 + 'id' => $this->id,
  62 + ]);
  63 +
  64 + return $dataProvider;
  65 + }
  66 +}
... ...
models/ProductFrontendSearch.php
... ... @@ -100,7 +100,7 @@
100 100 'allModels' => $this->getSearchQuery($category, $params, $in_stock)
101 101 ->with('variant', 'videos')->all(),
102 102 'pagination' => [
103   - 'pageSize' => 10,
  103 + 'pageSize' => 11,
104 104 ],
105 105 'sort' => $sort,
106 106 ]
... ...
views/order-payment/_form.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use artweb\artbox\ecommerce\models\OrderPaymentLang;
  4 +use artweb\artbox\language\widgets\LanguageForm;
  5 +use kartik\select2\Select2;
  6 +use yii\helpers\Html;
  7 +use yii\widgets\ActiveForm;
  8 +
  9 +/* @var $this yii\web\View */
  10 +/* @var $model artweb\artbox\ecommerce\models\OrderPayment */
  11 +/* @var $form yii\widgets\ActiveForm */
  12 +/* @var $modelLangs OrderPaymentLang */
  13 +?>
  14 +
  15 +<div class="order-payment-form">
  16 +
  17 + <?php $form = ActiveForm::begin(); ?>
  18 +
  19 + <?= $form->field($model, 'status')
  20 + ->widget(Select2::className(), ( [
  21 + 'name' => 'status',
  22 + 'hideSearch' => true,
  23 + 'data' => [
  24 + 1 => \Yii::t('app', 'Active'),
  25 + 2 => \Yii::t('app', 'Inactive'),
  26 + ],
  27 + 'options' => [ 'placeholder' => \Yii::t('app', 'Select status...') ],
  28 + 'pluginOptions' => [
  29 + 'allowClear' => true,
  30 + ],
  31 + ] )) ?>
  32 +
  33 + <?= LanguageForm::widget([
  34 + 'modelLangs' => $modelLangs,
  35 + 'formView' => '@artweb/artbox/ecommerce/views/order-payment/_form_language',
  36 + 'form' => $form,
  37 + ]) ?>
  38 + <div class="form-group">
  39 + <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  40 + </div>
  41 +
  42 + <?php ActiveForm::end(); ?>
  43 +
  44 +</div>
... ...
views/order-payment/_form_language.php 0 โ†’ 100755
  1 +<?php
  2 +use artweb\artbox\ecommerce\models\OrderPaymentLang;
  3 +use artweb\artbox\language\models\Language;
  4 +use yii\web\View;
  5 +use yii\widgets\ActiveForm;
  6 +
  7 +/**
  8 + * @var OrderPaymentLang $model_lang
  9 + * @var Language $language
  10 + * @var ActiveForm $form
  11 + * @var View $this
  12 + */
  13 +?>
  14 +
  15 +
  16 +
  17 +
  18 +<?= $form->field($model_lang, '[' . $language->id . ']title')->textInput(['maxlength' => true]) ?>
  19 +
  20 +
  21 +
  22 +
  23 +
... ...
views/order-payment/_search.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model artweb\artbox\ecommerce\models\OrderPaymentSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="order-payment-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'id') ?>
  19 +
  20 + <div class="form-group">
  21 + <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
  22 + <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
  23 + </div>
  24 +
  25 + <?php ActiveForm::end(); ?>
  26 +
  27 +</div>
... ...
views/order-payment/create.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model artweb\artbox\ecommerce\models\OrderPayment */
  8 +
  9 +$this->title = 'Create Order Payment';
  10 +$this->params['breadcrumbs'][] = ['label' => 'Order Payments', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="order-payment-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + 'modelLangs' => $modelLangs
  20 + ]) ?>
  21 +
  22 +
  23 +</div>
... ...
views/order-payment/index.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel artweb\artbox\ecommerce\models\OrderPaymentSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = 'Order Payments';
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="order-payment-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a('Create Order Payment', ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'status',
  28 + [
  29 + 'attribute' => 'title',
  30 + 'value' => 'lang.title',
  31 + ],
  32 +
  33 + ['class' => 'yii\grid\ActionColumn'],
  34 + ],
  35 + ]); ?>
  36 +</div>
... ...
views/order-payment/update.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model artweb\artbox\ecommerce\models\OrderPayment */
  7 +
  8 +$this->title = 'Update Order Payment: ' . $model->id;
  9 +$this->params['breadcrumbs'][] = ['label' => 'Order Payments', 'url' => ['index']];
  10 +$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
  11 +$this->params['breadcrumbs'][] = 'Update';
  12 +?>
  13 +<div class="order-payment-update">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 +
  18 + <?= $this->render('_form', [
  19 + 'model' => $model,
  20 + 'modelLangs' => $modelLangs
  21 + ]) ?>
  22 +
  23 +
  24 +</div>
... ...
views/order-payment/view.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model artweb\artbox\ecommerce\models\OrderPayment */
  8 +
  9 +$this->title = $model->id;
  10 +$this->params['breadcrumbs'][] = ['label' => 'Order Payments', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="order-payment-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 + 'id',
  32 + ],
  33 + ]) ?>
  34 +
  35 +</div>
... ...