Reputation: 5784
I have a codeigniter application. Today i added the tank_auth plugin. it works great but there is one thing i don't know. how do i print the username on the page?
In the documentation of tank_auth they say
get_username: Get username for authenticated user, FALSE otherwise. This method is meaningless if username is not used on registration (in this case it returns an empty string for every user).\
But can is how the username in my views? and how should i do that?
thanks
Upvotes: 0
Views: 198
Reputation: 7895
You can use get_username
.
BUT, you have to set the users username, otherwise get_username
will return FALSE
.
So, if you have a user, and that user is logged in, and that user has a username set (not just an email address), you can display the username via:
echo $this->tank_auth->get_username();
Upvotes: 0