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.
我在 Joomla 1.5 上,我正在尝试将我的登录模块的用户名值传递给一篇文章,该值在用户登录时显示为问候语,因此我可以将文章自定义为用户的个人资料。最好的方法是什么?谢谢
最简单的方法是使用 Joomla 的用户对象。
喜欢 :
$user = &JFactory::getUser(); echo $user->name;//You will get name,username,email etc .using same object
在文章部分只使用上面的行。在 components/com_content/view/article/default.php 或您想要的任何其他视图中。
用户对象将返回当前记录的用户信息。
希望对你有帮助..