You are here

public function entity_views_handler_area_entity::get_render_tokens in Entity API 7

Get the 'render' tokens to use for advanced rendering.

This runs through all of the fields and arguments that are available and gets their values. This will then be used in one giant str_replace().

1 call to entity_views_handler_area_entity::get_render_tokens()
entity_views_handler_area_entity::render_entity in views/handlers/entity_views_handler_area_entity.inc
Render an entity using the view mode.

File

views/handlers/entity_views_handler_area_entity.inc, line 133
Renders a full entity in a views area.

Class

entity_views_handler_area_entity
@file Renders a full entity in a views area.

Code

public function get_render_tokens() {
  $tokens = array();
  if (!empty($this->view->build_info['substitutions'])) {
    $tokens = $this->view->build_info['substitutions'];
  }
  $count = 0;
  foreach ($this->view->display_handler
    ->get_handlers('argument') as $arg => $handler) {
    $token = '%' . ++$count;
    if (!isset($tokens[$token])) {
      $tokens[$token] = '';
    }

    // Use strip tags as there should never be HTML in the path.
    // However, we need to preserve special characters like " that
    // were removed by check_plain().
    $tokens['%' . $count] = $handler->argument;
  }
  return $tokens;
}