Description
Api\User\Object user()
Using our user() function will give you access to the active users information using class properties.
Examples
<?php // Prints the users ID echo user()->id; // Prints the users email echo user()->email;
In case you want to get information from other user:
$user = (new \Api\User())->get(19); echo $user->email; //or echo (new \Api\User())->get(19)->email; //with 19 is user_id of other user.
Methods
Property | Type | Description |
---|---|---|
id | int | Unique user ID#. |
url | string | Permalink to users profile. |
name | string | Full name.
|
string | ||
name_link | string | HTML link to the users profile with wrapped around their name. |
photo | array | An associative array of photos of the user. Available sizes: 50px, 120px, 200px & original Usage: echo user()->photo['50px'] |
photo_link | string | HTML link to a users profile wrapped around their profile image. |
location | array | An associative array of a users location. Available values: iso Usage: user()->location['iso'] |
gender | array | An associative array of a users gender. Available values: id = Gender ID, name = Gender phrase Usage: user()->gender['name'] |
dob | array | An associative array of a users date of birth. Available values: day = Gender ID, month = Gender phrase, year = Year Usage: echo user()->dob['day'] . '/' . user()->dob['month'] . '/' . user()->dob['year']; |
group | object | An associative object of a users user group. Available values: id = User Group ID Usage: echo user()->group->id; |