PHP Classes

File: views/backend/media/index.php

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 Website Module   views/backend/media/index.php   Download  
File: views/backend/media/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: 1,181 bytes
 

Contents

Class file image Download
<?php

use backend\models\PageSearch;
use
yii\data\ActiveDataProvider;
use
yii\helpers\Url;
use
yii\web\View;
use
yii\widgets\ListView;
use
vinpel\DropZone\DropZone;

/* @var $this View */
/* @var $searchModel PageSearch */
/* @var $dataProvider ActiveDataProvider */

$this->title = Yii::t('website','Media');

$this->params['breadcrumbs'][] = $this->title;
$module = $this->context->module->id;

?>
<div class="content-index">

    <header class="mb-4 pb-2 border-bottom">
        <h1><?= $this->title ?></h1>
    </header>

    <?=
    DropZone
::widget([
       
'options' => [
           
'paramName' => "Media[filename]",
           
'method' => 'post',
           
'url' => Url::toRoute(["/$module/media/upload"]),
        ],
    ]);
   
?>

    <div class="card my-4">
        <div class="card-body">
            <?= $this->render('_search', [
               
'model' => $searchModel
           
]) ?>
</div>
    </div>

    <?=
    ListView
::widget([
       
'dataProvider' => $dataProvider,
       
'layout' => '<div class="row">{items}</div>{pager}',
       
'itemOptions' => ['class' => 'col-sm-6 col-md-3'],
       
'itemView' => '_view',
    ])
   
?>

</div>