问题标签 [joomla-jtable]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1933 浏览

joomla - Class 'JTable' not found

I am using Joomla 2.5.11 . I have a php file stored in the /public_html/joomtest/components/com_jumi/files which is pasted below. I have a PHP form which is stored in the same location i.e /public_html/joomtest/components/com_jumi/files.

I want the PHP form to call the PHP script so that an article is created in Joomla. But whenever the PHP script is called, I receive the below error

and the line on which Joomla throws error is

PHP script

I tried putting in

but this again didnt work. Please help.

0 投票
1 回答
84 浏览

database - 如何通过 JTable 访问 Joomla 中的联系人?

仍在处理我的组件,我目前正在尝试添加、编辑和删除联系人。我发现它们位于contact_details。使用 JFactory::getDBO() 访问它们是有效的。文档说,使用 JTable 更安全,并且是使用数据库的预期方式。

使用 JTable::getInstance('contact_details') 会导致错误提示,'contact_details' is not supported。有没有办法使用 JTable 访问contact_details?我是否必须创建一个自定义表才能使其工作?

提前致谢!

0 投票
1 回答
319 浏览

joomla3.0 - JTable用多列键删除行

我正在尝试使用 JTable delete() 在多列表中删除记录。表是一个链接表,定义为:

因为我没有单个主键,所以我不能使用 .delete($pk) 但我必须将记录加载到 JTable 实例中。

根据 JTable.delete($pk) 上的 Joomla 3.6 文档

$pk 是:“要删除的可选主键值。如果未设置,则使用实例属性值。”

因此,如果我省略 $pk 当前加载的实例应该被删除。但是我得到一个“不允许空主键”。我上面的代码中的异常。

如何删除具有多列键的记录?

PS:我知道我可以直接使用 SQL 语句,但是我的表类设置为进行跟踪/记录,我想坚持使用它们。

0 投票
1 回答
197 浏览

php - 添加 Joomla!文章的自定义字段

一段时间以来,Joomla!提供将自定义字段添加到文章中的可能性。

现在我想通过 Joomla! 创建新文章!Api,使用以下代码可以正常工作(Joomla! 文档中也使用了该代码):

但现在我还想添加自定义字段值?我怎么做?不幸的是 Joomla!文档没有说明这一点(并且非常过时)。