1<?php
2
3namespace ComboStrap;
4
5
6use ComboStrap\TagAttribute\StyleAttribute;
7
8class SectionTag
9{
10
11
12    public const CANONICAL = HeadingTag::CANONICAL;
13    public const TAG = "section";
14
15    public static function renderEnterXhtml(TagAttributes $tag): string
16    {
17        $level = $tag->getComponentAttributeValueAndRemoveIfPresent(HeadingTag::LEVEL);
18        if ($level !== null) {
19            $tag->addClassName(StyleAttribute::addComboStrapSuffix("outline-section"));
20            $tag->addClassName(StyleAttribute::addComboStrapSuffix("outline-level-$level"));
21        }
22        return $tag->toHtmlEnterTag("section");
23    }
24
25    public static function renderExitXhtml(): string
26    {
27        return '</section>';
28    }
29
30
31}
32
33