Exemple #1
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use frontend\assets\AdminAsset;
$this->registerJsFile('/js/custom/switch-banner.js', ['depends' => AdminAsset::className()]);
$this->title = 'Баннеры';
$this->params['breadcrumbs'][] = $this->title;
?>
<div id="content">
    <div class="outer">
        <div class="inner bg-light lter">
            <div id="collapse4" class="body">
                <!--Begin Datatables-->
                <div class="image-index">

                    <h1><?php 
echo Html::encode($this->title);
?>
</h1>


                    <p>
                        <?php 
echo Html::a('Загрузить баннер(ы)', ['/banner/default/upload'], ['class' => 'btn btn-success']);
?>
                    </p>
              

                    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['name', ['attribute' => 'name', 'format' => 'html', 'value' => function ($dataProvider) {
Exemple #2
0
<?php

use frontend\assets\AdminAsset;
use vova07\imperavi\Widget;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
$this->registerJsFile('/js/custom/image-upload.js', ['depends' => AdminAsset::className()]);
?>
<div id="content">
    <div class="outer">
        <div class="inner bg-light lter">
            <div id="collapse4" class="body">
                <div class="brend-index">
                    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'id' => 'form-article']]);
?>
                    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
                    <?php 
echo $form->field($model, 'article_category')->dropDownList([NULL => ''] + ArrayHelper::map(common\models\ArticleCategory::find()->all(), 'id', 'name'));
?>
                    <?php 
echo $form->field($model, 'template')->dropDownList([NULL => ''] + ArrayHelper::map(common\models\Template::find()->all(), 'id', 'name'));
?>
                    <?php 
echo $form->field($model, 'content')->widget(Widget::className(), ['settings' => ['iframe' => true, 'air' => true, 'formatting' => ['iframe'], 'lang' => 'ru', 'minHeight' => 400, 'pastePlainText' => true, 'buttonSource' => true, 'focus' => true, 'imageUpload' => '/blog/upload', 'imageManagerJson' => '/blog/uploaded', 'plugins' => ['clips', 'fullscreen', 'imagemanager']]]);
?>
                    <?php