Joomla调用系统自带编辑器的实现方法

时间:2021-10-13 13:20:26

本文实例讲述了Joomla调用系统自带编辑器的方法。分享给大家供大家参考,具体如下:

调用Joomla系统带的编辑器:

路径: /libraries/joomla/html/editor.php

类:JEditor

函数: 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()])

参数说明:

string $name 控件的名称, (会出现在控件的name里)
string $html 文本区域的内容
string $width 该文本的面积的宽度
string $height 该文本的面积的高度
int $col 对textarea的列数
int $row 对textarea的行数
boolean $buttons 为true 时编辑器按钮会显示出来
string $id 控件的id值,如果不给id值,会显示控件的名称 (会出现在控件的id里)
string $asset 
object $author 
array $params 关联数组编辑器的参数。

例子:

在view.html.php中

?
1
$editor =& JFactory::getEditor();

在模板文件default.php中

复制代码 代码如下:
echo $editor->display('控件name值','内容','宽','高','列数','行数',true, '控件id值');

希望本文所述对大家基于joomla程序设计有所帮助。