Even more helpers.

This commit is contained in:
Relintai 2021-11-16 16:54:28 +01:00
parent 7e4c5eeb3e
commit b8b2d5a3a6
2 changed files with 25 additions and 0 deletions

View File

@ -1524,6 +1524,28 @@ HTMLBuilder *HTMLBuilder::fa(const String &href, const String &body, const Strin
return this; return this;
} }
HTMLTag *HTMLBuilder::div(const String &cls, const String &id) {
HTMLTag *t = div();
if (cls != "") {
t->cls(cls);
}
if (id != "") {
t->id(id);
}
return t;
}
HTMLBuilder *HTMLBuilder::fdiv(const String &body, const String &cls, const String &id) {
div(cls, id);
w(body);
cdiv();
return this;
}
//Closing tags //Closing tags
HTMLBuilder *HTMLBuilder::ca() { HTMLBuilder *HTMLBuilder::ca() {

View File

@ -307,6 +307,9 @@ public:
HTMLTag *a(const String& href, const String& cls = "", const String& id = ""); HTMLTag *a(const String& href, const String& cls = "", const String& id = "");
HTMLBuilder *fa(const String& href, const String& body, const String& cls = "", const String& id = ""); HTMLBuilder *fa(const String& href, const String& body, const String& cls = "", const String& id = "");
HTMLTag *div(const String& cls, const String& id = "");
HTMLBuilder *fdiv(const String& body, const String& cls = "", const String& id = "");
//closing tags c prefix means close //closing tags c prefix means close
//Note simple tags should not have these like <br> //Note simple tags should not have these like <br>
//Note that I might have a few that shouldn't be here, those will be removed as I find them //Note that I might have a few that shouldn't be here, those will be removed as I find them