important = true; $this->hints[] = error($hint, true, true); } else { $this->hints[] = info($hint, true, true); } } } /** * Render the added hints to a popover for the toolbar. * * @return string */ public function render() { if (count($this->hints) > 0) { $class_hint = $this->important ? 'danger' : 'info'; $icon = $this->important ? 'exclamation-triangle' : 'info-circle'; $data_bs_attributes = [ 'toggle' => 'popover', 'container' => 'body', 'placement' => 'bottom', 'custom-class' => 'popover--userhints', 'html' => 'true', 'content' => htmlspecialchars(join('', $this->hints)), ]; $attr = ''; foreach ($data_bs_attributes as $attr_key => $attr_value) { $attr .= ' data-bs-' . $attr_key . '="' . $attr_value . '"'; } return ''; } return ''; } }