1 render_example.module render_example_cache_pre_render($element)

A '#pre_render' function.

Parameters

array $element: The element which will be rendered.

Return value

array: The altered element. In this case we add the #markup.

Related topics

File

modules/examples/render_example/render_example.module, line 184
Hook implementations for the Render Example module.

Code

function render_example_cache_pre_render($element) {
  $element['#markup'] = render_example_cache_expensive();

  // The following line is due to the bug described in
  // http://DOCUMENTATION_PENDING/node/914792. A #markup element's #pre_render must set
  // #children because it replaces the default #markup pre_render, which is
  // backdrop_pre_render_markup().
  $element['#children'] = $element['#markup'];
  return $element;
}