我为 Joomla 2.5 创建了一个新组件。我有两个功能:
public function getBase(){
if(JFactory::getUser()->guest) {
$this->base = 'Гость';
}
else {
$user =& JFactory::getUser();
$usr_id = $user->get('id');
/**/
$this->base = 'Гуд юзер id '.$usr_id.'';
/*Get database info*/
}
return $this->base;
}
public function getGetInfo() {
$this->getinfo = '11 '.$usr_id.'';
return $this->getinfo;
}
请告诉我如何在函数中使用$usr_id = $user->get('id');
from 。谢谢您的帮助。getBase()
getGetInfo()