ThinkPHP中應用FCK有關問題

來源:互聯網
上載者:User
ThinkPHP中應用FCK問題
//FCK
vendor("FCKeditor.fckeditor");
$editor = new FCKeditor();
$editor->Width = '100%';
$editor->Height = '400';
$this ->Value = $_POST['content'];
$editor->InstanceName = 'content';
$fckHtml = $editor->Createhtml();
$this->assign('fckHtml',$fckHtml);

上面代碼在ADD方法使用沒有錯誤,而在EDIT方法使用提示:非法操作ThinkPHP,什麼問題呢?請高手指教!

------解決方案--------------------
沒提示非法操作什麼嗎?

PHP code
public function index(){……//其他代碼vendor(”FCKeditor.fckeditor”);//包含FCKeditor類庫,TP引入第三方類庫的系統方法,其路徑是相對於vendor目錄來說的。$editor= new FCKeditor();   //執行個體化FCKeditor對象$editor->Width=’980′;//設定編輯器實際需要的寬度。此項省略的話,會使用預設的寬度。$editor->Height=’400′;//設定編輯器實際需要的高度。此項省略的話,會使用預設的高度。$this->Value=”;//設定編輯器初始值。也可以是修改資料時的設定值。可以置空。$editor->InstanceName=’comment’;//設定編輯器所在表單內輸入標籤的id與name,即標籤的id與name。此處假            //設為comment.此處不可省,也要保持唯一性。表單上傳到伺服器處理常式後,即可通過$_POST['comment']來讀取。$html=$editor->Createhtml();//建立線上編輯器html代碼字串,並賦值給字串變數$html.$this->assign(’html’,$html);//將$html的值賦給模板變數$html.在模板裡通過{$html}可以直接引用。…….//其他代碼,包括輸出模板。} 
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.