You are here

protected function PluginController::array2ul in Plugin 8

Convert a multi-level array to UL list.

1 call to PluginController::array2ul()
PluginController::overview in src/Controller/pluginController.php

File

src/Controller/pluginController.php, line 160
Contains \Drupal\plugin\PluginController.

Class

PluginController
Provides content for dialog tests.

Namespace

Drupal\plugin\Controller

Code

protected function array2ul($array) {
  $output = '<ul>';
  foreach ($array as $key => $value) {
    if (is_object($value)) {
      continue;
    }
    $value = is_array($value) ? $this
      ->array2ul($value) : String::checkPlain($value);
    $output .= "<li><b>{$key}:</b> <em>{$value}</em></li>";
  }
  return $output . '</ul>';
}