Download & Extend

Token Functions

The basic idea is that when one defines the token they add an addition param of function which is a callback to be used.

<?php
  $info
['tokens']['f']['cap'] = array(           
   
'name' => t('Capitalize'),               
   
'description' => t("Capitalizes the value. ") . token_function_help(1),
   
'dynamic' => TRUE,                                           
   
'function' => 'strtoupper',     
  );  
?>

so cap would take what ever the X in [f:cap:X] and capitalize it.
one can use multiple params separated by :
and one can use tokens but they need to be wrapped in {} instead of []

Downloads

Version Downloads Date Links
7.x-1.x-dev tar.gz (8.36 KB) | zip (8.88 KB) 2012-May-03 Notes

Project Information


Maintainers for Token Functions

  • e2thex - 1 commit
    last: 3 weeks ago, first: 3 weeks ago

Issues for Token Functions

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports