Example: Block

Same name in other branches
  1. 3.x modules/block_example/block_example.module \block_example
  2. 7.x-1.x block_example/block_example.module \block_example

Demonstrates code creation of blocks.

This example demonstrates how a module can define blocks that can be displayed on various pages of a site, and how to alter blocks provided by other modules.

Parent topics

File

modules/block_example/block_example.module, line 10

Functions

Title Sort descending File name Summary
block_example_block_view_alter modules/block_example/block_example.module Implements hook_block_view_alter().

Classes

Title Sort descending File name Summary
BlockExampleMenuTest modules/block_example/tests/src/Functional/BlockExampleMenuTest.php Test the user-facing menus in Block Example.
BlockExampleTest modules/block_example/tests/src/Functional/BlockExampleTest.php Test the configuration options and block created by Block Example module.