You are here

function render_example_change_to_ol in Examples for Developers 7

Adds a #type to the element before it gets rendered.

In this case, changes from the default 'ul' to 'ol'.

Parameters

array $element: The element to be altered, in this case a list, ready for theme_item_list.

Return value

array The altered list (with '#type')

Related topics

1 string reference to 'render_example_change_to_ol'
render_example_page_alter in render_example/render_example.module
Implements hook_page_alter().

File

render_example/render_example.module, line 530
Demonstrates render arrays.

Code

function render_example_change_to_ol($element) {
  $element['#type'] = 'ol';
  return $element;
}