ExampleRenderable.php

Same filename and directory in other branches
  1. 9 core/modules/system/tests/modules/twig_theme_test/src/ExampleRenderable.php
  2. 8.9.x core/modules/system/tests/modules/twig_theme_test/src/ExampleRenderable.php
  3. 11.x core/modules/system/tests/modules/twig_theme_test/src/ExampleRenderable.php

Namespace

Drupal\twig_theme_test

File

core/modules/system/tests/modules/twig_theme_test/src/ExampleRenderable.php

View source
<?php

namespace Drupal\twig_theme_test;

use Drupal\Core\Render\RenderableInterface;

/**
 * Provides an example implementation of the RenderableInterface.
 */
class ExampleRenderable implements RenderableInterface {
  
  /**
   * {@inheritdoc}
   */
  public function toRenderable() {
    return [
      '#markup' => 'Example markup',
    ];
  }

}

Classes

Title Deprecated Summary
ExampleRenderable Provides an example implementation of the RenderableInterface.

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