lass Controller_Main extends Controller {
public function __construct() {
$this->model = new Model_Category_Materials();
$this->view = new View();
}
function action_index() {
$materials = $this->model->get_category_materials();
$this->view->generate('content_view.php','template_view.php', ['materials' => $materials, 'video' => $video]);
}
}
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use app\models\Project;
/* @var $this yii\web\View */
/* @var $searchModel app\models\risktSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Risks';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="risk-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Create Risk', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'name_risk',
'status_risk',
'name_project',
'name_issue',
'name_kill_risk',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
Не совсем понимаю((