list of all accesses

This commit is contained in:
glambertessa 2020-09-09 14:50:13 +03:00
parent 38069c57d4
commit 99380c6ae3
3 changed files with 54 additions and 0 deletions

View File

@ -61,6 +61,21 @@ class AccessesController extends Controller
]);
}
/**
* Lists all Accesses models.
* @return mixed
*/
public function actionAll()
{
$searchModel = new AccessesSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('all', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Accesses model.
* @param integer $id

View File

@ -0,0 +1,38 @@
<?php
use app\modules\accesses\models\AccessesSearch;
use kartik\grid\GridView;
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\accesses\models\AccessesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Доступы';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="accesses-index">
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a('Добавить доступ', ['create'], ['class' => 'btn btn-success']) ?>
<?= Html::a('Сгруппированный вид', ['index'], ['class' => 'btn btn-success']) ?>
</p>
<?php
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'name',
'login',
'password',
'link',
'project',
'info'
],
]);
?>
</div>

View File

@ -17,6 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
<p>
<?= Html::a('Добавить доступ', ['create'], ['class' => 'btn btn-success']) ?>
<?= Html::a('Все доступы', ['all'], ['class' => 'btn btn-success']) ?>
</p>
<?php