我的自定义组件和模块有问题。在 XML 表单中我创建了这个字段
<field name="bio" type="editor" height="250" label="Biography"
description="Intro To The Artist" buttons="true" />
现在数据可以从数据库正确加载。
我在 View 中使用此代码输出 Wyswig 编辑器和正确的 html $this->form->getInput('bio');
但是当我保存时,表格。一切都按预期保存,除了所有 html 都被删除。
我不知道这种情况通常发生在哪里,即使我将 XML 添加到模块中(该模块通常负责所有渲染)。一切都显示正常,但 HTML 被删除了。
Joomla wiki 似乎不完整,我找不到有关如何解决此问题的有用信息。
谢谢
最佳答案
在 Google 群组中找到了解决方案。我需要将 filter="safehtml"
添加到该字段
<field name="bio" type="editor" height="250" label="Biography" filter="safehtml"
description="Intro To The Artist" buttons="true" />
我相信这是 Joomla 1.6 特有的,另一个设置可能是 filter="raw"
关于joomla - 自定义模块/组件无法保存 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5782005/