Commit 68412777 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлен метод просмотра курса

parent 255e6a80
......@@ -14,8 +14,9 @@ class CourseAdminController extends AdminController {
return [
'Manage' => 'Управление курсами',
'Create' => 'Добавление нового курса',
'View' => 'Просмотр курса',
'Update' => 'Редактирование курса',
'Delete' => 'Удаление курса'
'Delete' => 'Удаление курса',
];
}
......@@ -55,6 +56,12 @@ class CourseAdminController extends AdminController {
);
}
public function actionView($id){
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* @param $id
* @return string|\yii\web\Response
......
<?php use yii\widgets\DetailView; ?>
<h1>Просмотр курса #<?= $model->id; ?></h1>
<div class="analytics-school-view">
<?=
DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'name',
'description:ntext',
'image:ntext',
],
]);
?>
</div>
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