You are here

class RecursivePlaceholdersTest in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RecursivePlaceholdersTest

Hierarchy

Expanded class hierarchy of RecursivePlaceholdersTest

See also

\Drupal\Tests\Core\Render\RendererPlaceholdersTest::testRecursivePlaceholder()

File

core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php, line 1146
Contains \Drupal\Tests\Core\Render\RendererPlaceholdersTest.

Namespace

Drupal\Tests\Core\Render
View source
class RecursivePlaceholdersTest implements TrustedCallbackInterface {

  /**
   * #lazy_builder callback; bubbles another placeholder.
   *
   * @param string $animal
   *   An animal.
   *
   * @return array
   *   A renderable array.
   */
  public static function callback($animal) {
    return [
      'another' => [
        '#create_placeholder' => TRUE,
        '#lazy_builder' => [
          'Drupal\\Tests\\Core\\Render\\PlaceholdersTest::callback',
          [
            $animal,
          ],
        ],
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public static function trustedCallbacks() {
    return [
      'callback',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RecursivePlaceholdersTest::callback public static function #lazy_builder callback; bubbles another placeholder.
RecursivePlaceholdersTest::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.