'OK', 1 => 'WARNING', 2 => 'CRITICAL', 3 => 'UNKNOWN', 99 => 'PENDING', ); public function renderStateBadges($summary) { $html = ''; foreach ($summary as $state => $cnt) { if ($cnt === 0) continue; if ($state === 0) continue; $stateName = $this->stateNames[$state]; $html .= '' . $cnt . ''; } if ($html !== '') { $html = '
' . $html . '
'; } return $html; } }