class username extends Twig_Extension

Methods

string
getName()

Get the name of this extension

array
getFunctions()

Returns a list of global functions to add to the existing list.

string
get_username()

Get username details for placing into templates.

Details

at line 23
string getName()

Get the name of this extension

Return Value

string

at line 33
array getFunctions()

Returns a list of global functions to add to the existing list.

Return Value

array

An array of global functions

at line 56
string get_username()

Get username details for placing into templates.

How to use in a template:

  • {{ username('mode', user_id, username, user_colour, guest_username, custom_profile_url) }}
  • {{ username('mode', user_row, guest_username, custom_profile_url) }} It's possible to provide the user identifier, name and colour separately, or provide the entire user row at once as an array.

The mode, user_id and username are required (separately or through a user row). The other fields (user_colour|guest_username|custom_profile_url) are optional.

Return Value

string

A string based on what is wanted depending on $mode