Wt  3.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Static Public Member Functions | List of all members
Wt::WTemplate::Functions Struct Reference

A collection of predefined functions. More...

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 id (WTemplate *t, const std::vector< WString > &args, std::ostream &result)
 A function that resolves the id of a bound widget. More...
 

Detailed Description

A collection of predefined functions.

See Also
addFunction()

Member Function Documentation

bool Wt::WTemplate::Functions::block ( WTemplate t,
const std::vector< WString > &  args,
std::ostream &  result 
)
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:
...
${block:form-field category}
...

would look-up the following message:

<message id="form-field">
<div class="control-group">
${{1}-info}
</div>
</message>

and render as:

...
<div class="control-group">
${category-info}
</div>
...
bool Wt::WTemplate::Functions::id ( WTemplate t,
const std::vector< WString > &  args,
std::ostream &  result 
)
static

A function that resolves the id of a bound widget.

  For example, when bound to the function <tt>"id"</tt>, template text
  that contains a place-holder
... ${id:name} ...

will be resolved to the value of:

t->resolveWidget("name")->id()

This is useful for binding labels to input elements.

See Also
addFunction()
bool Wt::WTemplate::Functions::tr ( WTemplate t,
const std::vector< WString > &  args,
std::ostream &  result 
)
static

A function that resolves to a localized string.

  For example, when bound to the function <tt>"tr"</tt>, template
  that contains the placeholder
... ${tr:name} ...

will be resolved to the value of:

WString::tr("name")
See Also
addFunction()

Generated on Fri May 31 2013 for the C++ Web Toolkit (Wt) by doxygen 1.8.3.1