mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added 2 more helpers to HTMLBuilder.
This commit is contained in:
parent
eee908912d
commit
7e4c5eeb3e
@ -1500,6 +1500,30 @@ HTMLTag *HTMLBuilder::wbr() {
|
||||
return tag.start("wbr");
|
||||
}
|
||||
|
||||
HTMLTag *HTMLBuilder::a(const String &href, const String &cls, const String &id) {
|
||||
HTMLTag *t = input_text();
|
||||
|
||||
t->href(href);
|
||||
|
||||
if (cls != "") {
|
||||
t->cls(cls);
|
||||
}
|
||||
|
||||
if (id != "") {
|
||||
t->id(id);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
HTMLBuilder *HTMLBuilder::fa(const String &href, const String &body, const String &cls, const String &id) {
|
||||
a(href, cls, id);
|
||||
w(body);
|
||||
ca();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
//Closing tags
|
||||
|
||||
HTMLBuilder *HTMLBuilder::ca() {
|
||||
|
@ -304,6 +304,9 @@ public:
|
||||
HTMLTag *video();
|
||||
HTMLTag *wbr();
|
||||
|
||||
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 = "");
|
||||
|
||||
//closing tags c prefix means close
|
||||
//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
|
||||
|
Loading…
Reference in New Issue
Block a user