我的组件模型中有这个功能:
public function getTotProperty($user){
$database = &JFactory::getDBO();
$database->setQuery("SELECT created_by FROM #__jea_properties WHERE created_by=$user");
$results = $database->loadObjectList();
return $results;
}
我需要从组件的模板中调用这个函数。没有 var $user
,它可以工作:
echo $this->get('TotProperty');
但我需要$user
在函数中传递 var
通常,非 Joomla 方法是 getTotProperty($user);
如何将变量$user
从模型传递到模板?