You are here

public static function PlaceholdersTest::callbackPerUser in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Render/RendererTestBase.php \Drupal\Tests\Core\Render\PlaceholdersTest::callbackPerUser()

#lazy_builder callback; attaches setting, generates markup, user-specific.

Parameters

string $animal: An animal.

Return value

array A renderable array.

File

core/tests/Drupal/Tests/Core/Render/RendererTestBase.php, line 291
Contains \Drupal\Tests\Core\Render\RendererTestBase.

Class

PlaceholdersTest

Namespace

Drupal\Tests\Core\Render

Code

public static function callbackPerUser($animal) {
  $build = static::callback($animal);
  $build['#cache']['contexts'][] = 'user';
  return $build;
}