Get the currently logged in user ($user API variable as a function)

This function behaves the same as the $user API variable, though does support optional shortcut arguments for getting or setting values.

Usage

// basic usage
$user = user();

// usage with all arguments
$user = user(string $key = '', null $value = null);

Arguments

NameType(s)Description
key (optional)string

Optional property to get or set

value (optional)null

Optional value to set

Return value

User mixed


Functions methods and properties

API reference based on ProcessWire core version 3.0.236

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull