Ejemplo n.º 1
0
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save']);
?>
    </div>
<?php 
$this->endBlock('submit');
?>

    <section id="widget-grid">
        <div class="row">

            <article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
                <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Watermark'), 'icon' => 'list-ul', 'footer' => $this->blocks['submit']]);
$options = [];
if ($model->isNewRecord === false) {
    $this->registerCss('span.file-input > div.file-preview {display:block;}');
    $this->registerCss('.file-preview img {max-width:100%;}');
    $options = ['initialPreview' => [Html::img($model->file)]];
}
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => $options]);
echo $form->field($model, 'position')->dropDownList(Watermark::getPositions());
BackendWidget::end();
?>
            </article>


        </div>
    </section>

<?php 
ActiveForm::end();