Changed to article (attributes and children preserved/updated):
\n"; +echo $maker->run($contentBlock); +echo "\n"; + + +// --- 4. Toggling Classes --- +echo "
4. Toggling CSS Classes:
\n"; +$panel = HtmlTag::div('panel')->setId('info-panel'); +echo "Initial panel: " . $maker->run($panel) . "\n"; + +// Add 'visible' and 'active' classes +$panel->toggleClass('visible', 'active'); +echo "Panel after toggling 'visible' and 'active': " . $maker->run($panel) . "\n"; + +// Remove 'active' class by toggling it again +$panel->toggleClass('active'); +echo "Panel after toggling 'active' again: " . $maker->run($panel) . "\n"; +echo "\n"; diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..1f170c9 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,17 @@ + +