Wt
4.11.1
|
A collection of predefined functions. More...
#include <WTemplate.h>
Static Public Member Functions | |
static bool | tr (WTemplate *t, const std::vector< WString > &args, std::ostream &result) |
A function that resolves to a localized string. More... | |
static bool | block (WTemplate *t, const std::vector< WString > &args, std::ostream &result) |
A function that renders a macro block. More... | |
static bool | while_f (WTemplate *t, const std::vector< WString > &args, std::ostream &result) |
A function that renders a macro block as long as the given condition is true. More... | |
static bool | id (WTemplate *t, const std::vector< WString > &args, std::ostream &result) |
A function that resolves the id of a bound widget. More... | |
A collection of predefined functions.
|
static |
A function that renders a macro block.
The function will consider the first argument as the key for a localized string that is a macro block, and additional arguments as positional parameters in that block.
For example, a template that contains:
would look-up the following message:
and render as:
|
static |
A function that resolves the id of a bound widget.
For example, when bound to the function "id"
, template text that contains a place-holder
will be resolved to the value of:
This is useful for binding labels to input elements.
|
static |
A function that resolves to a localized string.
For example, when bound to the function "tr"
, template that contains the placeholder
will be resolved to the value of:
|
static |
A function that renders a macro block as long as the given condition is true.
The function will consider the first argument as the condition, and the second argument as the key for a localized string that is a macro block.
Just like the block() function, you can provide additional arguments, so the third argument will be what is filled in into {1}
in the macro block, etc.