Added a new clsse helper method to HTMLBuilder.

This commit is contained in:
Relintai 2022-02-06 15:49:23 +01:00
parent 7cb505ee09
commit c7fa9caac4
2 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,16 @@ HTMLTag *HTMLTag::cls(const String &val) {
return this; return this;
} }
HTMLTag *HTMLTag::clsse(const String &val) {
if (val == "") {
return this;
}
attrib("class", val);
return this;
}
HTMLTag *HTMLTag::id(const String &val) { HTMLTag *HTMLTag::id(const String &val) {
attrib("id", val); attrib("id", val);

View File

@ -15,6 +15,7 @@ public:
HTMLTag *style(const String &val); HTMLTag *style(const String &val);
HTMLTag *href(const String &val); HTMLTag *href(const String &val);
HTMLTag *cls(const String &val); HTMLTag *cls(const String &val);
HTMLTag *clsse(const String &val); //se -> skip empty
HTMLTag *id(const String &val); HTMLTag *id(const String &val);
HTMLTag *name(const String &val); HTMLTag *name(const String &val);
HTMLTag *content(const String &val); HTMLTag *content(const String &val);