How to tokenize a value in a custom field formatter for views? I am using an custom field formatter for a view field like this:

function custom_fields_field_formatter_info() {

  return array(
    // the key must be unique, so it's best to prefix with your module's name.
    'custom_fields_breadcrumbs' =&gt; array(
      'label' =&gt; t('Breadcrumbs'),
      'field types' =&gt; array('entityreference'),
    ),
  );
}

/**
* Implements hook_field_formatter_settings_form().
*/
function custom_fields_field_formatter_settings_form($field, $instance, $view_mode, $form, &amp;$form_state) {

  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
   if ($display['type'] == 'custom_fields_breadcrumbs') {
    $form = array();
       $form['active'] = array(
      '#type' =&gt; 'textfield',
      '#title' =&gt; t('Mark as active'),
      '#description' =&gt; t('You can specify a node id, which should have class "active". Yo can use replacement tokens.'),
      '#default_value' =&gt; $settings['active'],
      '#size' =&gt; 4,
      '#maxlength' =&gt; 128,
      '#required' =&gt; FALSE,
    );    
  }
    return $form;
}
function custom_fields_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

  $element = array();
  $settings = $display['settings'];

  switch ($display['type']) {
     case 'custom_fields_breadcrumbs':
      $ids = array();
      foreach ($items as $item) {
        $ids[$item['target_id']] = $item['target_id'];
      }
      $items = array();
      // http://api.drupal.org/api/drupal/modules!node!node.module/function/node_load_multiple/7
      $items = node_load_multiple($ids, array(), FALSE);
      foreach ($items as $delta =&gt; $item) {
        $label = $item-&gt;title;
        // modeled after entityreference_field_formatter_view() in entityreference.module
        if ($display['settings']['link'] &amp;&amp; ($uri = node_uri($item))) {
          $otpions = array();
          if (isset($settings['active']) &amp;&amp; $delta == $settings['active']) {
            $otpions = array('attributes' =&gt; array('class' =&gt; array('active')) );
          }
          $element[$delta] = array('#markup' =&gt; l($label, $uri['path'], $otpions));
        }
        else {
          $element[$delta] = array('#markup' =&gt; check_plain($label));
        }
      }
      break;
  }
  return $element;
}


Everything works as expected, but I want to be able to use replacement patterns for my custom setting $settings['active']. How do I do this?

I think, I have to use the method:

tokenize_value()


from the views object. But I don't have the views object within the hook, haven't I?
I found out how to do this. We have the views object via the parameter "display", so we can use:

$display['views_view']-&gt;style_plugin-&gt;tokenize_value($settings['pager']['active'], 0)


to tokenize a field value.