getValueAndRemove(self::DISPLAY); if ($display !== null) { $value = strtolower($display); switch ($value) { case self::DISPLAY_NONE_VALUE: $tagAttributes->addStyleDeclarationIfNotSet("display", "none"); return; case self::DISPLAY_NONE_IF_EMPTY_VALUE: try { $id = $tagAttributes->getId(); } catch (ExceptionNotFound $e) { $id = $tagAttributes->getDefaultGeneratedId(); $tagAttributes->setId($id); } $css = "#$id:empty { display: none; }"; ExecutionContext::getActualOrCreateFromEnv() ->getSnippetSystem() ->attachCssInternalStyleSheet("display-none-if-empty-$id", $css); return; } } } }