コード例 #1
0
ファイル: _form.php プロジェクト: oakcms/oakcms
?>
    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true])->translatable();
?>
    <?php 
echo $form->field($model, 'subtitle')->textInput(['maxlength' => true])->translatable();
?>
    <?php 
echo $form->field($model, 'slug')->hint(Yii::t('admin', 'If you\'ll leave this field empty, slug will be generated automatically'))->textInput(['maxlength' => true])->translatable();
?>

    <?php 
echo $form->field($model, 'content')->widget(\app\widgets\Editor::className())->translatable();
?>
    <?php 
echo $form->field($model, 'description')->widget(\app\widgets\Editor::className())->translatable();
?>

    <div class="form-group">
        <div class="row">
            <div class="col-md-3">

            </div>
            <div class="col-md-9">
                <?php 
echo Html::img($model->getUploadUrl('background_image') ?: '/uploads/user/non_image.png', ['class' => 'img-thumbnail', 'style' => 'max-width:300px']);
?>
                <br>
                <?php 
echo $model->getUploadUrl('background_image') ? Html::a(Yii::t('content', 'Delete Image'), ['delete-image', 'id' => $model->id], ['class' => 'label-danger']) : '';
?>
コード例 #2
0
ファイル: _form.php プロジェクト: oakcms/oakcms
echo $form->field($model, 'category_id')->widget(Select2::classname(), ['data' => Category::buildTextTree(), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите категорию ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

            <?php 
echo $form->field($model, 'producer_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Producer::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите бренд ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
        <div class="col-lg-6 col-xs-6">
            <?php 
echo $form->field($model, 'category_ids')->label('Прочие категории')->widget(Select2::classname(), ['data' => Category::buildTextTree(), 'language' => 'ru', 'options' => ['multiple' => true, 'placeholder' => 'Доп. категории ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>

    <?php 
echo $form->field($model, 'text')->widget(\app\widgets\Editor::className());
?>

    <?php 
echo $form->field($model, 'short_text')->textInput(['maxlength' => true]);
?>

    <?php 
echo Gallery::widget(['model' => $model]);
?>

    <div class=" panel panel-default">
        <div class="panel-heading"><strong>Связанные продукты</strong></div>
        <div class="panel-body">
            <?php 
echo \app\modules\relations\widgets\Constructor::widget(['model' => $model]);
コード例 #3
0
ファイル: _form.php プロジェクト: oakcms/oakcms
        <div class="tab-content">
            <div class="tab-pane active" id="tab_1">
                <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true])->translatable();
?>
                <?php 
echo $form->field($model, 'slug')->hint(Yii::t('admin', 'If you\'ll leave this field empty, slug will be generated automatically'))->textInput(['maxlength' => true])->translatable();
?>
                <?php 
echo $form->field($model, 'category_id')->dropDownList(\yii\helpers\ArrayHelper::map(\app\modules\content\models\ContentCategory::find()->published()->all(), 'id', 'title'));
?>
                <?php 
echo $form->field($model, 'description')->widget(\app\widgets\Editor::className())->translatable();
?>
                <?php 
echo $form->field($model, 'content')->widget(\app\widgets\Editor::className())->translatable();
?>
                <div class="form-group">
                    <div class="row">
                        <div class="col-md-3">

                        </div>
                        <div class="col-md-9">
                            <?php 
echo Html::img($model->getUploadUrl('image') ?: '/uploads/user/non_image.png', ['class' => 'img-thumbnail', 'style' => 'max-width:300px']);
?>
                        </div>
                    </div>
                </div>
                <?php 
echo $form->field($model, 'image')->fileInput(['accept' => 'image/*']);