Fix binds in HTMLTemplate.

This commit is contained in:
Relintai 2024-02-26 11:52:13 +01:00
parent af492fc79e
commit 2fe82c604c
2 changed files with 3 additions and 3 deletions

View File

@ -727,11 +727,11 @@ void HTMLTemplate::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_template_text", "name"), &HTMLTemplate::get_template_text);
ClassDB::bind_method(D_METHOD("process_template_expression", "expression", "data"), &HTMLTemplate::process_template_expression);
ClassDB::bind_method(D_METHOD("render_template", "text", "request", "data"), &HTMLTemplate::render_template);
ClassDB::bind_method(D_METHOD("render_template", "text", "data"), &HTMLTemplate::render_template);
ClassDB::bind_method(D_METHOD("get_and_render_template", "name", "request", "data"), &HTMLTemplate::get_and_render_template);
BIND_VMETHOD(MethodInfo("_render",
BIND_VMETHOD(MethodInfo(Variant::STRING, "_render",
PropertyInfo(Variant::OBJECT, "request", PROPERTY_HINT_RESOURCE_TYPE, "WebServerRequest"),
PropertyInfo(Variant::DICTIONARY, "data")));

View File

@ -144,7 +144,7 @@ void HTMLTemplateData::load_from_string(const String &p_data) {
// Section header: [ Section Name ]
// Should not have whitespace in front and back
String l = lines[i];
if (l.begins_with("[") && l.ends_with("]")) {
if (!current_section_name.empty()) {
_templates[current_section_name] = current_str;