TestLayoutMainFooter.php

Same filename in other branches
  1. 9 core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php
  2. 10 core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php
  3. 11.x core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php

Namespace

Drupal\field_layout_test\Plugin\Layout

File

core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php

View source
<?php

namespace Drupal\field_layout_test\Plugin\Layout;

use Drupal\Core\Layout\LayoutDefault;

/**
 * Provides an annotated layout plugin for field_layout tests.
 *
 * @Layout(
 *   id = "test_layout_main_and_footer",
 *   label = @Translation("Test plugin: Main and Footer"),
 *   category = @Translation("Layout test"),
 *   description = @Translation("Test layout"),
 *   regions = {
 *     "main" = {
 *       "label" = @Translation("Main Region")
 *     },
 *     "footer" = {
 *       "label" = @Translation("Footer Region")
 *     }
 *   },
 *   config_dependencies = {
 *     "module" = {
 *       "dependency_from_annotation",
 *     },
 *   },
 * )
 */
class TestLayoutMainFooter extends LayoutDefault {
    
    /**
     * {@inheritdoc}
     */
    public function defaultConfiguration() {
        return [
            'setting_1' => 'Default',
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function calculateDependencies() {
        $dependencies = parent::calculateDependencies();
        $dependencies['module'][] = 'dependency_from_calculateDependencies';
        return $dependencies;
    }

}

Classes

Title Deprecated Summary
TestLayoutMainFooter Provides an annotated layout plugin for field_layout tests.

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