Created
September 7, 2013 06:50
-
-
Save ThomasHambach/6473409 to your computer and use it in GitHub Desktop.
Drupal 7, define header/footer/... for your view programatically.
This file contains 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 MYMODULE_views_data() { | |
$data = array(); | |
$data[' MYMODULE__global']['table']['group'] = t('My Module'); | |
$data[' MYMODULE__global']['table']['join'] = array( | |
'#global' => array(), | |
); | |
$data[' MYMODULE__global']['property'] = array( | |
'title' => t('My Module extras'), | |
'help' => t('Displays extra cats on your view!'), | |
'area' => array( | |
'handler' => 'MY_MODULE_views_handler_area_cats', | |
), | |
); | |
return $data; | |
} | |
/** | |
* @inheritdoc views_handler_area | |
*/ | |
class MY_MODULE_views_handler_area_cats extends views_handler_area { | |
public function render($empty = FALSE) { | |
return theme('MY_MODULE_display_more_cats'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment