简体   繁体   English

Joomla! 用户名问候

[英]Joomla! Username Greeting

How can I take advantage of the Joomla! 我如何利用Joomla! 1.6 login variable that displays the greeting of an authenticated user? 1.6登录变量,显示已认证用户的问候? In other words. 换一种说法。 Let's say I wanted to greet the user somewhere else how can I do so? 假设我想在其他地方打招呼,该怎么办? What files do i have to include into my extension and what variable or what exactly produces this greeting? 我必须在扩展程序中包括哪些文件,什么变量或产生此问候的确切内容?

You will need to access the User object. 您将需要访问User对象。 I haven't tested this, but it should work - 我尚未对此进行测试,但它应该可以工作-

$user = JFactory::getUser();
$name = $user->get('name');

Substitute username for name if you need the login name instead of the real name. 如果您需要登录名而不是真实姓名,请用用户名代替名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM