hanleyhansen
hanleyhansen

Reputation: 6452

Joomla! Username Greeting

How can I take advantage of the Joomla! 1.6 login variable that displays the greeting of an authenticated user? 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?

Upvotes: 0

Views: 252

Answers (1)

Brent Friar
Brent Friar

Reputation: 10609

You will need to access the User object. 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.

Upvotes: 1

Related Questions