user_var

Retrieves a user variable.

Example

1
2
3
4
{{ $a | user_var: 'id' }} => 123
{{ $a | user_var: 'name' }} => John Doe
{{ $a | user_var: 'email' }} => john.doe@example.com
{{ $a | user_var: 'phone' }} => +46701234567

Input

Type Parameter Description Required
string varName The name of the variable to retrieve. Comes before the | sign. Required
int|null userId The ID of the user to retrieve the variable for, defaults to the current user  

Output

Type Description  
mixed null The value of the variable or null if the variable is not found