如何在自定义组件视图中添加 joomla 编辑器但不使用 XML 表单字段? [英] How to add joomla editor in custom component view but without using XML form fields?

查看:15
本文介绍了如何在自定义组件视图中添加 joomla 编辑器但不使用 XML 表单字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个自定义的 joomla 组件.我想在我的一个组件视图中添加一个 joomla 编辑器字段.我知道如何使用 XML 表单文件 (models/forms/myview.xml) 添加编辑器,但我想在不使用 xml 文件字段的情况下在视图文件 (myview/tmpl/default.php) 中执行相同操作.是否可以 ?如果是那怎么办?

I am developing a custom joomla component. I want to add a joomla editor field in my one of my component view. I know how to add editor using XML form file (models/forms/myview.xml), but I want to do the same in view file (myview/tmpl/default.php) without using the xml file fields. Is it possible ? If it is then how ?

请帮忙

推荐答案

试试这个,

     $editor = JFactory::getEditor();
     echo $editor->display('content', $this->content, '550', '400', '60', '20', false);

对于更多

在最新的 Joomla 版本 J3.x [更新]

In Latest Joomla version J3.x [UPDATE]

你可以使用类似下面的东西,

you can use something like below,

jimport( 'joomla.html.editor' );
$editor = JEditor::getInstance(JFactory::getUser()->getParam("editor"));
echo $editor->display('content', $this->content, '550', '400', '60', '20', false);

了解更多

这篇关于如何在自定义组件视图中添加 joomla 编辑器但不使用 XML 表单字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆