From c5cecfde1d15f0436201aa87dd7eaae44e8e3d32 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 17 Jun 2013 01:19:04 +0200 Subject: [PATCH] Issue #1898456 by joelpittet: Common_test().module - Convert theme_ functions to Twig. --- .../tests/modules/common_test/common_test.module | 8 +------- .../templates/common-test-foo.html.twig | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 core/modules/system/tests/modules/common_test/templates/common-test-foo.html.twig diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module index febfd3adcc7..0334219484c 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -249,17 +249,11 @@ function common_test_theme() { return array( 'common_test_foo' => array( 'variables' => array('foo' => 'foo', 'bar' => 'bar'), + 'template' => 'common-test-foo', ), ); } -/** - * Provides a theme function for drupal_render(). - */ -function theme_common_test_foo($variables) { - return $variables['foo'] . $variables['bar']; -} - /** * Implements hook_library_info_alter(). */ diff --git a/core/modules/system/tests/modules/common_test/templates/common-test-foo.html.twig b/core/modules/system/tests/modules/common_test/templates/common-test-foo.html.twig new file mode 100644 index 00000000000..6f9b471a47f --- /dev/null +++ b/core/modules/system/tests/modules/common_test/templates/common-test-foo.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation for the common test foo. + * + * Available variables: + * - foo: foo. + * - bar: bar. + * + * @see template_preprocess() + * + * @ingroup themeable + */ +#} +{{ foo }}{{ bar -}}