Commit 069ab022 authored by Shakarim Sapa's avatar Shakarim Sapa

- Доделана страница с отображением всех шаблнов в базе

parent a6b98887
......@@ -9,6 +9,8 @@
namespace common\modules\messageTemplate\controllers;
use common\components\AdminController;
use common\modules\messageTemplate\models\MessageTemplate;
use yii\data\ActiveDataProvider;
class TemplateAdminController extends AdminController {
......@@ -25,8 +27,15 @@ class TemplateAdminController extends AdminController {
}
public function actionManage(){
$dataProvider = new ActiveDataProvider([
'query' => MessageTemplate::find()
]);
return $this->render(
'manage'
'manage',
[
'dataProvider' => $dataProvider
]
);
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: PHOENIX
* Date: 16.02.16
* Time: 20:44
*/
\ No newline at end of file
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<div class="trigger-trigger-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Добавить шаблон', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'name',
'template:html',
'created_at:datetime',
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update}{delete}',
],
],
]); ?>
</div>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment