public function Console::item_list in Site Audit 8.3
Theme an item list.
File
- src/
Renderer/ Console.php, line 272
Class
Namespace
Drupal\site_audit\RendererCode
public function item_list($element, $section = FALSE, $class = 'note') {
switch ($element['#list_type']) {
case 'ol':
$count = 1;
foreach ($element['#items'] as $item) {
$text = '<' . $class . '>' . $count . ':</> ' . $item;
if ($section) {
$this->output
->writeln($this->formatter
->formatSection($section, $text));
}
else {
$this->output
->writeln($text);
}
$count++;
}
break;
case 'ul':
default:
foreach ($element['#items'] as $item) {
$text = '<' . $class . '>*</> ' . $item;
if ($section) {
$this->output
->writeln($this->formatter
->formatSection($section, $text));
}
else {
$this->output
->writeln($text);
}
$count++;
}
break;
}
}