Answers.Body: <p>I think it's fair to say the new <code>Civi\Token\TokenProcessor</code> model is still evolving, but the older method still works and is the easier option for now unless it is not sufficient for your needs.</p>
  
  <p>You can find a range of extensions doing things with tokens <a href="https://civicrm.org/extensions?title=&amp;body_value=token&amp;field_extension_cms_tid=All&amp;field_extension_ready_value=All&amp;sort_by=field_extension_current_usage_value&amp;sort_order=DESC" rel="nofollow noreferrer">here</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-05T10:19:02.630Z
Answers.LastActivityDate: 2019-08-05T10:19:02.630Z
Answers.UserDisplayName: Aidan
Body: <p>I am working on an extension that is going to use a custom token from Drupal content. I found the great example <a href="https://civicrm.org/blog/colemanw/create-your-own-tokens-for-fun-and-profit" rel="nofollow noreferrer">blog post from CiviCRM 4.1</a> but it appears that in CiviCRM 4.7 tokens switched to using <code>Civi\Token\TokenProcessor</code>. I have looked at a few extensions that do not appear to be using this model. Is there a good example (other than the documentation) of the new model.</p>
  
  <p>Thanks,
  Josh</p>
  
Tags: <tokens>
Title: Token Example Module
ThreadText: # Token Example Module
  
  (Asked by: username_0 on 2019-08-05)
  
  I am working on an extension that is going to use a custom token from Drupal content. I found the great example [blog post from CiviCRM 4.1](https://civicrm.org/blog/colemanw/create-your-own-tokens-for-fun-and-profit) but it appears that in CiviCRM 4.7 tokens switched to using `Civi\Token\TokenProcessor`. I have looked at a few extensions that do not appear to be using this model. Is there a good example (other than the documentation) of the new model.
  
  Thanks,
  username_0
  
  **Tags:** tokens
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-05. Score: 1
  
  I think it's fair to say the new `Civi\Token\TokenProcessor` model is still evolving, but the older method still works and is the easier option for now unless it is not sufficient for your needs.
  
  You can find a range of extensions doing things with tokens [here](https://civicrm.org/extensions?title=&body_value=token&field_extension_cms_tid=All&field_extension_ready_value=All&sort_by=field_extension_current_usage_value&sort_order=DESC)
  
  
  ---
  
  