user->data (method)

Return to Knowledgebase

Purpose

Provides quick access to a piece of info about a logged in user

Location

users/classes/User.php

Parameters

This function does not take any arguments

Example

user->data()->username

Further Documentation:

The logged in User's info is always readily available through user->data(). Generally the logged in user's info is stored in the $user variable so you can echo a username with username can be replaced with any column in the users table including ones you add yourself.