Revision of hook_theme in Drupal 7.x from Fri, 2012-02-24 17:25

<?php
/**
 * Drupal 6.x
 **/
function MY_MODULE_example_function() {
  return
theme('map_search', $results->response);
}
function
theme_map_search($variables = '') {
  return
kprint_r($variables['response'], true);
}
?>

<?php
/**
 * Drupal 7.x
 **/
function MY_MODULE_example_function() {
  return
theme('map_search', array('response' => $results->response));
}

function
MY_MODULE_search_theme($existing, $type, $theme, $path) {
  return array(
   
'map_search' => array(
     
'arguments' => array('response' => NULL),
    ),
  );
}

function
theme_map_search($variables = '') {
  return
kprint_r($variables['response'], true);
}
?>
Google