You are here

function contextual_links_example_theme in Examples for Developers 7

Implements hook_theme().

See also

template_preprocess_contextual_links_example_object()

Related topics

File

contextual_links_example/contextual_links_example.module, line 274
Shows how to use Drupal's contextual links functionality.

Code

function contextual_links_example_theme() {

  // The core Contextual Links module imposes two restrictions on how an object
  // must be themed in order for it to display the object's contextual links in
  // the user interface:
  // - The object must use a template file rather than a theme function. See
  //   contextual-links-example-object.tpl.php for more information on how the
  //   template file should be structured.
  // - The first variable passed to the template must be a renderable array. In
  //   this case, we accomplish that via the most common method, by passing a
  //   single renderable element.
  return array(
    'contextual_links_example_object' => array(
      'template' => 'contextual-links-example-object',
      'render element' => 'element',
    ),
  );
}