mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Added more form helpers.
This commit is contained in:
parent
ff28b413d2
commit
eee908912d
@ -502,6 +502,17 @@ HTMLTag *HTMLTag::method(const String &val) {
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLTag *HTMLTag::method_get() {
|
||||
attrib("method", "get");
|
||||
|
||||
return this;
|
||||
}
|
||||
HTMLTag *HTMLTag::method_post() {
|
||||
attrib("method", "post");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLTag *HTMLTag::action(const String &val) {
|
||||
attrib("action", val);
|
||||
|
||||
@ -2331,6 +2342,47 @@ HTMLBuilder *HTMLBuilder::cwbr() {
|
||||
return this;
|
||||
}
|
||||
|
||||
HTMLTag *HTMLBuilder::form_get() {
|
||||
write_tag();
|
||||
|
||||
return tag.start("form")->method_get();
|
||||
}
|
||||
HTMLTag *HTMLBuilder::form_post() {
|
||||
write_tag();
|
||||
|
||||
return tag.start("form")->method_post();
|
||||
}
|
||||
HTMLTag *HTMLBuilder::form_get(const String &action, const String &cls, const String &id) {
|
||||
HTMLTag *t = form_get();
|
||||
|
||||
t->fora(action);
|
||||
|
||||
if (cls != "") {
|
||||
t->cls(cls);
|
||||
}
|
||||
|
||||
if (id != "") {
|
||||
t->id(id);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
HTMLTag *HTMLBuilder::form_post(const String &action, const String &cls, const String &id) {
|
||||
HTMLTag *t = form_post();
|
||||
|
||||
t->fora(action);
|
||||
|
||||
if (cls != "") {
|
||||
t->cls(cls);
|
||||
}
|
||||
|
||||
if (id != "") {
|
||||
t->id(id);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
HTMLTag *HTMLBuilder::input_button() {
|
||||
write_tag();
|
||||
|
||||
|
@ -111,6 +111,9 @@ public:
|
||||
HTMLTag *pattern(const String &val);
|
||||
|
||||
HTMLTag *method(const String &val);
|
||||
HTMLTag *method_get();
|
||||
HTMLTag *method_post();
|
||||
|
||||
HTMLTag *action(const String &val);
|
||||
HTMLTag *type(const String &val);
|
||||
HTMLTag *placeholder(const String &val);
|
||||
@ -431,6 +434,11 @@ public:
|
||||
HTMLBuilder *cvideo();
|
||||
HTMLBuilder *cwbr();
|
||||
|
||||
HTMLTag *form_get();
|
||||
HTMLTag *form_post();
|
||||
HTMLTag *form_get(const String& action, const String& cls = "", const String& id = "");
|
||||
HTMLTag *form_post(const String& action, const String& cls = "", const String& id = "");
|
||||
|
||||
HTMLTag *input_button();
|
||||
HTMLTag *input_checkbox();
|
||||
HTMLTag *input_color();
|
||||
|
Loading…
Reference in New Issue
Block a user