home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (block_test.module)

This example Drupal source code file (block_test.module) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, block, block_test_block_info, block_test_block_view, blocks, caching, delta, drupal_cache_per_role, function, html, id, info, php, return

The block_test.module Drupal example source code

<?php
// $Id: block_test.module,v 1.3 2010/06/15 16:19:28 dries Exp $

/**
 * @file
 *   Provide test blocks.
 */

/**
 * Implements hook_block_info().
 */
function block_test_block_info() {
  $blocks['test_cache'] = array(
    'info' => t('Test block caching'),
    'cache' => variable_get('block_test_caching', DRUPAL_CACHE_PER_ROLE),
  );

  $blocks['test_html_id'] = array(
    'info' => t('Test block html id'),
  );
  return $blocks;
}

/**
 * Implements hook_block_view().
 */
function block_test_block_view($delta = 0) {
  return array('content' => variable_get('block_test_content', ''));
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal block_test.module source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.