Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By cj-1 on
Man, I feel like an idiot for asking, but here goes...
I simply want to print out the currently logged in user's name on the page. I've tried print $user->name, but that doesn't return anything. I've tried to look through the code to see if I could come across a clue, but alas - I'm clueless.
Can someone fill me in?
Thanks!
Comments
try this
thanks!
That worked, thanks! Just curious, is there a list of all variables that can be accessed in the same way? I looked at the get_variable function, but that looks like it only grabs from the variables table in the database (please give me hell if I'm wrong).
Thanks again for the quick reply!
Also
And if you want the username to be a link to the user's information page, you can do: