Block

Create a block programatically in Drupal 8

​​block_example.PNG

Basic creation of a block in Drupal 8. As seen in the image on the left, a predefined library structure is needed to create a block plugin.

The annotations plugin is used to handle the block id, subject and admin label from within the comment block. The annotation class is found at core/lib/Drupal/Component/Annotation/Plugin.php.

Subscribe to RSS - Block