PHP Classes

File: views/backend/menu/index.php

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 Website Module   views/backend/menu/index.php   Download  
File: views/backend/menu/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Yii2 Website Module
Add a content page management system to a site
Author: By
Last change:
Date: 1 month ago
Size: 890 bytes
 

Contents

Class file image Download
<?php

use yii\helpers\Html;
use
yii\widgets\ListView;
use
yii\widgets\Pjax;

/* @var $this yii\web\View */
/* @var $searchModel daxslab\website\models\MenuSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('website','Menus');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="menu-index">

    <header class="mb-4 pb-2 border-bottom">
        <h1><?= Html::encode($this->title) ?></h1>
    </header>

    <p>
        <?= Html::a(Yii::t('website','New...'), ['create']) ?>
</p>

    <?= ListView::widget([
       
'layout' => '{items}',
       
'dataProvider' => $dataProvider,
       
'options' => ['tag' => 'ol'],
       
'itemOptions' => ['tag' => 'li'],
       
'itemView' => function ($model, $key, $index, $widget) {
            return
Html::a(Html::encode($model->name), ['update', 'id' => $model->id]);
        },
    ])
?>
</div>