DeprecatedTwigTemplateController.php

Same filename and directory in other branches
  1. 10 core/modules/system/tests/modules/deprecated_twig_template/src/Controller/DeprecatedTwigTemplateController.php

Namespace

Drupal\deprecated_twig_template\Controller

File

core/modules/system/tests/modules/deprecated_twig_template/src/Controller/DeprecatedTwigTemplateController.php

View source
<?php

namespace Drupal\deprecated_twig_template\Controller;

use Drupal\Core\Controller\ControllerBase;

/**
 * Controller for calling a deprecated theme.
 */
class DeprecatedTwigTemplateController extends ControllerBase {
    
    /**
     * Display the deprecated template with a message.
     *
     * @return array
     *   Render array containing the deprecated template.
     */
    public function deprecatedTwigTemplate() {
        return [
            '#theme' => 'deprecated_template',
            '#message' => 'This is a deprecated template. Use an alternative template.',
        ];
    }

}

Classes

Title Deprecated Summary
DeprecatedTwigTemplateController Controller for calling a deprecated theme.

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