function ThemeTestHooks::theme

Implements hook_theme().

File

core/modules/system/tests/modules/theme_test/src/Hook/ThemeTestHooks.php, line 19

Class

ThemeTestHooks
Hook implementations for theme_test.

Namespace

Drupal\theme_test\Hook

Code

public function theme($existing, $type, $theme, $path) : array {
    $items['theme_test'] = [
        'file' => 'theme_test.inc',
        'variables' => [
            'foo' => '',
        ],
    ];
    $items['theme_test_template_test'] = [
        'template' => 'theme_test.template_test',
    ];
    $items['theme_test_template_test_2'] = [
        'template' => 'theme_test.template_test',
    ];
    $items['theme_test_suggestion_provided'] = [
        'variables' => [],
    ];
    $items['theme_test_specific_suggestions'] = [
        'variables' => [],
    ];
    $items['theme_test_suggestions'] = [
        'variables' => [],
    ];
    $items['theme_test_general_suggestions'] = [
        'variables' => [
            'module_hook' => 'theme_test_theme',
            'theme_hook' => 'none',
        ],
    ];
    $items['theme_test_foo'] = [
        'variables' => [
            'foo' => NULL,
        ],
    ];
    $items['theme_test_render_element'] = [
        'render element' => 'elements',
    ];
    $items['theme_test_render_element_children'] = [
        'render element' => 'element',
    ];
    $items['theme_test_preprocess_suggestions'] = [
        'variables' => [
            'foo' => '',
            'bar' => '',
        ],
    ];
    $items['theme_test_preprocess_callback'] = [
        'variables' => [
            'foo' => '',
        ],
    ];
    $items['theme_test_registered_by_module'] = [
        'render element' => 'content',
        'base hook' => 'container',
    ];
    $items['theme_test_theme_class'] = [
        'variables' => [
            'message' => '',
        ],
    ];
    $items['theme_test_deprecations_preprocess'] = [
        'variables' => [
            'foo' => '',
            'bar' => '',
            'gaz' => '',
            'set_var' => '',
            'for_var' => '',
            'contents' => [],
        ],
    ];
    $items['theme_test_deprecations_child'] = [
        'variables' => [
            'foo' => '',
            'bar' => '',
            'gaz' => '',
        ],
    ];
    $items['theme_test_deprecations_hook_theme'] = [
        'variables' => [
            'foo' => '',
            'bar' => '',
            'deprecations' => [
                'foo' => "'foo' is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use 'new_foo' instead. See https://www.example.com.",
                'bar' => "'bar' is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use 'new_bar' instead. See https://www.example.com.",
            ],
        ],
    ];
    return $items;
}

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