/**
* Generates panel title for heading and footer.
*
* @param array $content the panel content settings.
* @param string $type whether `heading` or `footer`
*
* @return string
*/
protected static function getPanelTitle($content, $type)
{
$title = ArrayHelper::getValue($content, $type, '');
if (!Enum::isEmpty($title)) {
if (ArrayHelper::getValue($content, "{$type}Title", true) === true) {
$title = static::tag("h3", $title, ["class" => "panel-title"]);
}
return static::tag("div", $title, ["class" => "panel-{$type}"]) . "\n";
} else {
return '';
}
}