hook_token_info

function hook_token_info

hook_token_info()

Provide information about available placeholder tokens and token types.

Tokens are placeholders that can be put into text by using the syntax [type:token], where type is the machine-readable name of a token type, and token is the machine-readable name of a token within this group. This hook provides a list of types and tokens to be displayed on text editing screens, so that people editing text can see what their token options are.

The actual token replacement is done by \Drupal\Core\Utility\Token::replace(), which invokes 登录查看完整内容