PHP Classes

File: views/backend/media/_search.php

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

Contents

Class file image Download
<?php

use yii\helpers\Html;
use
yii\widgets\ActiveForm;
use
yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model backend\models\MediaSearch */
/* @var $form yii\widgets\ActiveForm */

$mimeTypeOptions = Yii::$app->website->getMedias()->select('mime_type')->column();
$mimeTypeOptions = array_combine($mimeTypeOptions, $mimeTypeOptions);

?>

<div class="media-search">

    <?php $form = ActiveForm::begin([
       
'action' => ['index'],
       
'method' => 'get',
    ]);
?>

    <div class="row">
        <div class="col-sm-8">
            <?= $form->field($model, 'filename') ?>
</div>
        <div class="col-sm-4">
            <?= $form->field($model, 'mime_type')->dropDownList($mimeTypeOptions, ['prompt' => Yii::t('website', '-- Choose one --')]) ?>
</div>
    </div>

    <div class="form-group">
        <?= Html::submitButton(Yii::t('website', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('website', 'Reset'), Url::current(['MediaSearch' => null]), ['class' => 'btn btn-default']) ?>
</div>

    <?php ActiveForm::end(); ?>

</div>