heredoc技术
1,以<<function uploadFile($button = 'button', $return = 'file', $type = 'file') {
$appRoot = __APP__;
$htmlBox = <<
KindEditor.ready(function(K) {
var uploadFile = K.editor({
allowFileManager : true,
fileManagerJson : '{$appRoot}/public/manager',
uploadJson : '{$appRoot}/public/upload',
fileType : '{$type}',
//urlType : 'relative'
});
K('#{$button}').click(function() {
uploadFile.loadPlugin('insertfile', function() {
uploadFile.plugin.fileDialog({
fileUrl : K('#{$return}').val(),
clickFn : function(url, title) {
K('#{$return}').val(url);
uploadFile.hideDialog();
}});});});});
Kindeditor;
return $htmlBox;
}
本站文章如未注明出处均为原创,转载请注明出处,如有侵权请邮件联系站长。