function field_layout_test_layout_alter in Drupal 10
Same name and namespace in other branches
- 8 core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module \field_layout_test_layout_alter()
- 9 core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.module \field_layout_test_layout_alter()
Implements hook_layout_alter().
File
- core/
modules/ field_layout/ tests/ modules/ field_layout_test/ field_layout_test.module, line 11 - Contains hook implementations for field_layout_test.
Code
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',
],
]);
}
}