@@ -293,9 +293,8 @@ public function arrays() {
293
293
// in addition to functions. See
294
294
// \Drupal\render_example\Controller\RenderExampleController::preRender()
295
295
// @todo: This doesn't work, we need to fix it.
296
- // https://www.drupal.org/project/examples/issues/2986435
297
- // $build['#pre_render'] = [static::class, 'preRender'];
298
-
296
+ // https://www.drupal.org/project/examples/issues/2986435
297
+ // $build['#pre_render'] = [static::class, 'preRender'];.
299
298
// Caching is an important part of the Render API, converting an array to a
300
299
// string of HTML can be an expensive process, and therefore whenever
301
300
// possible the Render API will cache the results of rendering an array in
@@ -387,7 +386,7 @@ public function arrays() {
387
386
],
388
387
];
389
388
390
- $ output = array () ;
389
+ $ output = [] ;
391
390
// We are going to create a new output render array that pairs each
392
391
// example with a set of helper render arrays. These are used to display
393
392
// the description as a title and the unrendered content alongside the
@@ -403,7 +402,7 @@ public function arrays() {
403
402
'rendered ' => $ build [$ key ],
404
403
'unrendered ' => [
405
404
'#type ' => 'markup ' ,
406
- '#markup ' => htmlentities (\ Drupal \ Component \ Utility \ Variable::export ($ build [$ key ])),
405
+ '#markup ' => htmlentities (Variable::export ($ build [$ key ])),
407
406
],
408
407
];
409
408
}
@@ -454,8 +453,8 @@ public static function preRender(array $element) {
454
453
// recursive so this will still be located, and rendered to HTML.
455
454
'rendered ' => $ child ,
456
455
// Export the element definition as a string of text so we can display
457
- // the array that was used to create the rendered output just below the
458
- // output.
456
+ // the array that was used to create the rendered output just below
457
+ // the output.
459
458
'unrendered ' => [
460
459
'#markup ' => htmlentities (Variable::export ($ child )),
461
460
],
0 commit comments