【发布时间】:2020-04-09 14:20:02
【问题描述】:
我正在尝试在 Joomla 中创建我的第一个组件,但我不明白它是如何工作的:D
我用“组件创建器”创建了一个基本组件。 (我节省了很多时间...)。
现在,我的数据库中有一个表,我在其中放置了我的数据:
id = 1
name = Andrea
note = Ciao
现在,我想使用 Joomla 语言从页面调用它。
在我的模型/component.php 上我写道:
class Variabili extends JModelLegacy
{
function estraivariabili()
{
$db =& JFactory::getDBO();
$db->setQuery("SELECT * FROM #__table")->loadObjectList();
return $value;
}
}
在我的default.php 上我写了
$model=$this->Variabili();
//call the method
$items=$model->estraivariabili();
//print
print_r($items);
但是在页面上我有这个错误:
0 Call to undefined method Calcolo_imposteViewCalcoloonline::Variabili()
哪里出错了?
请对我温柔,因为我是初学者:D
提前致谢
安德烈亚
【问题讨论】: