Ejemplo n.º 1
0
<?php

use common\modules\settings\helpers\SettingsHelper as Settings;
use common\modules\media\helpers\MediaLib as Media;
?>
<h1>Тестирование полей</h1>

<?php 
print_r(Media::getMedia(66));
?>

<?php 
$payments = \common\modules\settings\helpers\SettingsHelper::getField('repeater');
?>

Ejemplo n.º 2
0
    ?>
            <img class="img-responsive" style="margin: 0 auto;" src="<?php 
    echo MediaLib::getFolderUrl($model->file, $model->folder);
    ?>
">
        <?php 
} else {
    ?>
            <img class="img-responsive" style="margin: 0 auto;" src="<?php 
    echo MediaLib::getFolderUrl('document.png');
    ?>
">
        <?php 
}
?>
    </div>
    <div class="col-sm-6 col-xs-12">
        <?php 
$url = \yii\helpers\Url::to(MediaLib::getFolderUrl($model->file, $model->folder), true);
$model->data = unserialize($model->data);
?>
        <?php 
echo \yii\widgets\DetailView::widget(['model' => $model, 'attributes' => ['file', ['attribute' => 'file', 'format' => 'raw', 'value' => \yii\helpers\Html::input('text', 'url', $url, ['class' => 'form-control', 'readonly' => true]), 'label' => 'URL'], ['attribute' => 'file', 'format' => 'raw', 'value' => \common\modules\media\helpers\MediaLib::filesize_formatted($model->data['size']), 'label' => 'Размер файла'], 'mime_type', 'folder', 'created_at:datetime']]);
?>
        <p class="text-center">
            <?php 
echo \yii\helpers\Html::button('Удалить', ['class' => 'btn btn-sm btn-danger']);
?>
        </p>
    </div>
</div>