class template_engine.gd extends []

static func replace_variable

Parameters:
  • template (String)

  • placeholder_key (String)

  • value (Variant)

Return type:

String

static func render_dictionary

Iterate through the keys in the dictionary and recursively replace placeholders

Parameters:
  • template (String)

  • placeholder_key (String)

  • data (Dictionary)

Return type:

String

static func tokenize_template

Tokenizes the template into individual elements for processing

Parameters:
  • template (String)

  • placeholder_key (String)

Return type:

Array

static func render_forloops

Renders for-loops in the template with the provided data

Parameters:
  • template (String)

  • data (Dictionary)

  • placeholder_key (String)

Return type:

String

static func _render_forloops

Parameters:
  • template (String)

  • data (Dictionary)

  • forloops_block (String)

  • data_key (String)

  • loop_variable (String)

  • loop_content (String)

Return type:

String

static func render_template

Define a static function to render a template with data

Parameters:
  • template (String)

  • data (Dictionary)

Return type:

String