Jump to main content Jump to doc navigation


Grabs a processed Lexicon Entry.

This may also be a modLexicon object as well, if the Lexicon has been loaded. PHP supports having objects and methods with the same name.


API Doc: http://api.modx.com/revolution/2.2/db_core_model_modx_modx.class.html#%5CmodX::lexicon()

string lexicon (string $key, [array $params = array()])


Output the translation of the 'welcome_message' Entry, and sets the 'name' Placeholder in it.

echo $modx->lexicon('welcome_message',array('name' => 'John'));

The above example assumes a message that contains a placeholder for "name", e.g.

$_lang['welcome_message'] = 'Hello [[+name]]!  How are you today?';

See Also