function LazyBuilderPlaceholderTest::twigFiberSuspendLazyBuilderCallback
Lazy builder callback with test template.
Attributes
#[TrustedCallback]
Parameters
string $param: A parameter for the callback.
Return value
array A render array containing another lazy builder.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ LazyBuilderPlaceholderTest.php, line 129
Class
- LazyBuilderPlaceholderTest
- Tests Fiber suspension within Twig templates during placeholder rendering.
Namespace
Drupal\KernelTests\Core\RenderCode
public static function twigFiberSuspendLazyBuilderCallback(string $param) : array {
return [
'#type' => 'inline_template',
'#template' => '<div class="fibers-test">
First {{ fibers_test_function(message) }}
Second {{ fibers_test_function(message) }}
</div>',
'#context' => [
'message' => $param,
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.