'font-size: 48px; font-weight: bold; color: #000; text-align: center;', 'subtitle' => 'font-size: 24px; font-weight: normal; color: #555; text-align: center;', 'header' => 'font-size: 36px; font-weight: bold; color: #17375e;', 'footer' => 'font-size: 12px; font-weight: normal; color: #777;', // Add more styles as needed 'default' => 'font-size: 12px; font-weight: normal; color: #000;', 'content' => 'padding-left: 1rem; padding-right: 1rem; padding-top: 0.5rem; padding-bottom: 0.5rem;', ]; /** * Set the style for an element * @param string $element Element name / identifier (E.g. 'title', 'subtitle', 'header', etc.) * @param string $style CSS styles */ public function setStyle(string $element, string $style): void { $this->styles[$element] = $style; } /** * Get the title for the template * @param string|null $title Title * @param string|null $subtitle Subtitle * @return string HTML title */ public function getTitle(string $title = null, string $subtitle = null): string { $html = ''; if (!empty($title)) { $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); $html .= '

' . $title . '

'; } if (!empty($subtitle)) { $subtitle = htmlspecialchars($subtitle, ENT_QUOTES, 'UTF-8'); $html .= '

' . $subtitle . '

'; } return $html; } /** * Get the style for an element * @param string $element Element name / identifier (E.g. 'title', 'subtitle', 'header', etc.) * @return string CSS styles */ public function getStyle(string $element): string { return $this->styles[$element] ?? $this->styles['default']; } /** * Get the header title for the template * @param string|null $title Title * @return string HTML header title */ public function getHeaderTitle(string $title = null): string { $html = ''; if (!empty($title)) { $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); $html .= '' . $title . ''; } return $html; } /** * Get the CSS (default) styles for the template * @return string CSS styles */ public function getDefaultStyles(): string { return ' '; } }