Created
January 25, 2017 10:27
-
-
Save martsie/05171347b09e57ee47a72885fe5beacf to your computer and use it in GitHub Desktop.
Basic implementation of Drupal 7 hook_views_data()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_views_data(). | |
*/ | |
function my_custom_module_views_data() { | |
$data['my_custom_module']['table']['group'] = t('My custom module'); | |
$data['my_custom_module']['table']['join'] = array( | |
// Exist in all views. | |
'#global' => array(), | |
); | |
$data['my_custom_module']['my_custom_field'] = array( | |
'title' => t('My custom field'), | |
'help' => t('My custom field displays the word "Some custom markup".'), | |
'field' => array( | |
'handler' => 'views_handler_my_custom_field', | |
), | |
); | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment