Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在社区构建器专业插件中获取当前登录的用户 ID 我使用了这段代码,但它对我不起作用
$user=&JFactory::getUser(); $user->id;
试试下面的代码。这是一种替代方法。
$user =& JFactory::getUser(); $userId = $user->get( 'id' );
阅读更多。