问题是这个样子的,
首先我想使用新浪编辑器添加到我的页面中区
但是我的页面是使用的smarty模板引擎.
用如下代码声明了一个sinaeditor的实力,并且设置宽高.include_once('sinaedit/sinaEditor.class.php');
$editor=new sinaEditor('edit');
$editor->Value='';
$editor->BasePath='./sinaedit';
$editor->Height=500;
$editor->Width=700;
$editor->AutoSave=false;
之后我用smarty的assign方法,创建了一个编辑器$tpl->assign('edit',$editor->Create());
$tpl->display('admin/html/comintr.html');
可是现在遇到的问题是
在display模板之前,新浪编辑器的实例已经被呈现.
即使我去掉ASSIGN方法只要保留有$editor->Create()
那么编辑器依旧存在,并且置顶.还有一个更关键的问题是,我在提交form表单的时候没办法提交这个编辑器里面的内容,接收不到.
希望哪位大大,或者遇到过类似情况的人,帮忙解决下.小弟感激不尽啊.

解决方案 »

  1.   

    Create方法应该是直接把编辑器输出了, 看看有没有其他方法是返回编辑器的.
      

  2.   

    我已经发现了解决之道.问题在这里.打开sineeditor.class.php发现
    原来的create()方法是这样写的 function create(){
    $ReadCookie=$this->AutoSave?1:0;
    print <<<eot
    <textarea name="{$this->eName}" id="{$this->eName}" style="display:none;">{$this->Value}</textarea>
    <iframe src="{$this->BasePath}/Edit/editor.htm?id={$this->eName}&ReadCookie={$ReadCookie}" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" width="{$this->Width}" height="{$this->Height}"></iframe>
    eot;
    }
    }
    修改成这个样子就可以了 function create(){
    $ReadCookie=$this->AutoSave?1:0;
    $str =  <<<eot
    <textarea name="{$this->eName}" id="{$this->eName}" style="display:none;">{$this->Value}</textarea>
    <iframe src="{$this->BasePath}/Edit/editor.htm?id={$this->eName}&ReadCookie={$ReadCookie}" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" width="{$this->Width}" height="{$this->Height}"></iframe>
    eot;
    return $str;
    }
    }