field_layout_test.module

Same filename and directory in other branches
  1. 9 core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module
  2. 8.9.x core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module
  3. 10 core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module

Contains hook implementations for field_layout_test.

File

core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module

View source
<?php


/**
 * @file
 * Contains hook implementations for field_layout_test.
 */

/**
 * Implements hook_layout_alter().
 */
function field_layout_test_layout_alter(&$definitions) {
    
    /** @var \Drupal\Core\Layout\LayoutDefinition[] $definitions */
    if (\Drupal::state()->get('field_layout_test.alter_regions') && isset($definitions['layout_onecol'])) {
        $definitions['layout_onecol']->setRegions([
            'foo' => [
                'label' => 'Foo',
            ],
        ]);
    }
}

Functions

Title Deprecated Summary
field_layout_test_layout_alter Implements hook_layout_alter().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.