Exemplo n.º 1
0
            $fileType = \yii\helpers\FileHelper::getMimeType($file);
            $data = base64_encode(file_get_contents($file));
            echo "<img src='data:" . $fileType . ";base64," . $data . "' width=100><br>";
        } else {
            echo "<img src='{$image->thumb}' width=100><br>";
        }
        echo Yii::t('app', 'Sort Order') . ' <input style="width:50px" name="imageSort[' . $image->id . ']" value="' . $image->sort_order . '">';
        echo '</div>';
    }
    ?>
            <div style="clear:both"></div>
        </div>

        <div class="form-group">
            <?php 
    echo \backend\widgets\image\ImageDropzone::widget(['name' => 'file', 'url' => ['upload'], 'sortable' => true, 'sortableOptions' => [], 'htmlOptions' => [], 'options' => ['params' => ['productId' => $model->id]]]);
    ?>
        </div>

    <?php 
}
?>

    <div class="form-group">
        <label class="col-lg-2 control-label" for="">&nbsp;</label>
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php