You are here

function esi_block_block_view_alter in ESI: Edge Side Includes 7.3

Implements hook_block_view_alter().

File

modules/esi_block/esi_block.module, line 97
ESI handler for blocks.

Code

function esi_block_block_view_alter(&$data, $block) {

  // The region isn't known in hook_block_view().  This is the first hook where
  // the region is provided.
  if ($block->module == 'esi_block') {

    // Build a URL which contains all the necessary data.
    $url = url(esi_block_url($block), array(
      'absolute' => TRUE,
    ));
    $data['content'] = array(
      '#type' => 'esi',
      '#url' => $url,
    );
  }
}