diff --git a/core/html/html_builder.cpp b/core/html/html_builder.cpp index 6207e81..670704f 100644 --- a/core/html/html_builder.cpp +++ b/core/html/html_builder.cpp @@ -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() { diff --git a/core/html/html_builder.h b/core/html/html_builder.h index c9dffa3..d218ea0 100644 --- a/core/html/html_builder.h +++ b/core/html/html_builder.h @@ -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
//Note that I might have a few that shouldn't be here, those will be removed as I find them