Example: Token API

Examples using the Token API. (drupal 6)

The Token module provides an API for providing tokens to other modules. Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user].

This example is part of the Examples for Developers Project which you can download and experiment with here: http://drupal.org/project/examples

Functions & methods

NameDescription
token_entity_info
token_entity_load
token_example_example_formForm builder; display lists of supported token entities and text to tokenize.
token_example_example_form_submitSubmit callback; store the submitted values into storage.
token_example_menuImplements hook_menu().
token_example_token_listImplements hook_token_list().
token_example_token_valuesImplements hook_token_values().
_token_example_get_commentBuild a list of available comments.
_token_example_get_nodeBuild a list of available content.
_token_example_get_userBuild a list of availalbe user accounts.

examples/token_example/token_example.module, line 13