theme_item_list

  1. drupal
    1. 4.7
    2. 5
    3. 6 theme.inc
    4. 7 theme.inc
Versions
4.7 theme_item_list($items = array(), $title = NULL, $type = 'ul')
5 – 6 theme_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = NULL)
7 theme_item_list($variables)

Return a themed list of items.

Parameters

$items An array of items to be displayed in the list.

$title The title of the list.

$type The type of list to return (e.g. "ul", "ol")

Return value

A string containing the list output.

Related topics

Code

includes/theme.inc, line 869

<?php
function theme_item_list($items = array(), $title = NULL, $type = 'ul') {
  $output = '<div class="item-list">';
  if (isset($title)) {
    $output .= '<h3>' . $title . '</h3>';
  }

  if (!empty($items)) {
    $output .= "<$type>";
    foreach ($items as $item) {
      $output .= '<li>' . $item . '</li>';
    }
    $output .= "</$type>";
  }
  $output .= '</div>';
  return $output;
}
?>