YII 后端管理界面 图片显示源代码了
在视图层:
<script src="http://maps.google.cn/maps/api/js?key=AIzaSyA384lAOGgKz0OQeFYFYL1OjiDphk3wESY"></script>
<style>
.form-group, .form-control[type='text'], .form-group textarea {
width: 100% !important;
}
.form-group textarea {
min-height: 150px;
}
</style>
<?php if (!empty($model->content)) { ?>
<?php foreach ($model->content as $key => $items): ?>
<div class="form-group field-approve-approve_material">
<div style="min-height: 70px;">
<div style="width: 100px;display: inline-block;vertical-align: top" class="text-right">
<label class="control-label" for="approve-approve_profession">文字内容</label>
</div>
<div style="margin-left: 20px;width: calc(100% - 125px);display: inline-block;vertical-align: top">
<div style="min-height: 100% !important;height:100% !important;min-width:30px;margin: 5px;border: solid 1px #aaa" alt="">
<textarea id="baidu<?= $key ?>" style="height: 100%; min-height: 300px"> <?= $items['text']; ?></textarea>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<?php } ?>
//借用百度插件,还原副文本里面的图片
$().ready(function(){
var step_ueditor = 0;
$(".control-label").each(function () {
var id = "baidu" + step_ueditor;
util.getEditor(id, "dataData", {
initialFrameHeight: 240,
enableAutoSave: false,
initialFrameWidth: 770,
toolbars: [['link']]
});
step_ueditor++;
});
})