1<?php 2 3namespace ComboStrap; 4 5 6use ComboStrap\TagAttribute\BackgroundAttribute; 7use ComboStrap\TagAttribute\Hero; 8 9 10class JumbotronTag 11{ 12 13 14 public const TAG = 'jumbotron'; 15 16 17 public static function renderEnterXhtml(TagAttributes $tagAttributes): string 18 { 19 20 $bsVersion = Bootstrap::getBootStrapMajorVersion(); 21 switch ($bsVersion) { 22 case Bootstrap::BootStrapFourMajorVersion: 23 $jumbotronClass = "jumbotron"; 24 break; 25 default: 26 case Bootstrap::BootStrapFiveMajorVersion: 27 $jumbotronClass = "rounded"; 28 } 29 30 return $tagAttributes 31 ->addClassName($jumbotronClass) 32 ->toHtmlEnterTag("div"); 33 34 } 35 36 public static function renderExitHtml(): string 37 { 38 return '</div>'; 39 } 40 41 public static function getDefault(): array 42 { 43 return [ 44 Hero::ATTRIBUTE => "md", 45 BackgroundAttribute::BACKGROUND_COLOR => "#e9ecef", 46 Spacing::SPACING_ATTRIBUTE => "m-2" 47 ]; 48 } 49} 50 51