Skip to content

Instantly share code, notes, and snippets.

@robballou
Created May 15, 2012 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robballou/2703698 to your computer and use it in GitHub Desktop.
Save robballou/2703698 to your computer and use it in GitHub Desktop.
Custom Module basic block hooks
<?php
/**
* Implements hook_block_info
*/
function custom_module_block_info() {
$blocks['custom_module_my_block'] = array(
'info' => t('My block'),
'cache' => DRUPAL_CACHE_PER_PAGE,
);
return $blocks;
}
/**
* Implements hook_block_view
*
* Passes off the function call to _custom_module_view_DELTA
*/
function custom_module_block_view($delta = '') {
// our block code...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment