Joomla調(diào)用系統(tǒng)自帶編輯器的實(shí)現(xiàn)方法

字號:


    本文實(shí)例講述了Joomla調(diào)用系統(tǒng)自帶編輯器的方法。分享給大家供大家參考,具體如下:
    調(diào)用Joomla系統(tǒng)帶的編輯器:
    路徑: /libraries/joomla/html/editor.php
    類:JEditor
    函數(shù): void display( string $name, string $html, string $width, string $height, int $col, int $row, [boolean $buttons = true], [string $id = null], [string $asset = null], [object $author = null], [array $params = array()])
    參數(shù)說明:
    string $name 控件的名稱, (會出現(xiàn)在控件的name里)
    string $html 文本區(qū)域的內(nèi)容
    string $width 該文本的面積的寬度
    string $height 該文本的面積的高度
    int $col 對textarea的列數(shù)
    int $row 對textarea的行數(shù)
    boolean $buttons 為true 時編輯器按鈕會顯示出來
    string $id 控件的id值,如果不給id值,會顯示控件的名稱 (會出現(xiàn)在控件的id里)
    string $asset
    object $author
    array $params 關(guān)聯(lián)數(shù)組編輯器的參數(shù)。
    例子:
    在view.html.php中
    $editor =& JFactory::getEditor();
    在模板文件default.php中
    代碼如下:
    echo $editor->display('控件name值','內(nèi)容','寬','高','列數(shù)','行數(shù)',true, '控件id值');
    希望本文所述對大家基于joomla程序設(shè)計(jì)有所幫助。