Deployment Guide

266 | Modifiers Dell Networking W-ClearPass Guest 6.0 | Deployment Guide
The content after a {foreachelse} tag is included only if the {foreach} block would otherwise be empty.
Modifiers
Smarty provides
modifiers
that can be used to gain greater control over the formatting of data. Modifiers can be
included by following a variable with a vertical bar | and the name of the modifier. Any arguments to the modifier
can be specified using a colon : followed by the arguments.
The following example prints a date using the YYYY-MM-DD syntax:
{$expire_time|nwadateformat:"%Y-%m-%d"}
See"Date/Time Format Syntax" on page 279 for detailed information on the date/time format modifiers, and see
Table 26.
Modifier Description
htmlspecialchars
Escapes characters used in HTML syntax with the equivalent HTML entities (&amp; for &, &lt; for <
and &gt; for >)
nl2br Replaces newline characters in the value with HTML line breaks (<br>)
number_format
Formats a numerical value for display; an optional modifier argument may be used to specify the
number of decimal places to display (default is 0)
nwadateformat
Date/time formatting; see"nwadateformat Modifier" on page 279 for details about this modifier
function
nwatimeformat
Date/time formatting; see"Date/Time Format String Reference " on page 281 for details about
this modifier function
nwamoneyformat
Formats a monetary amount for display purposes; an optional modifier argument may be used to
specify the format string. This modifier is equivalent to the NwaMoneyFormat() function;
see"NwaMoneyFormat" on page 284 for details.
strtolower Converts the value to lowercase
strtoupper Converts the value to uppercase
ucfirst Converts the first character of the value to uppercase
ucwords Converts the first character of each word in the value to uppercase
Table 26:
Smarty Modifiers
Predefined Template Functions
Template functions are used to perform different kinds of processing when the template is used. The result of a
template function takes the place of the function in the output of the template.
Functions are of two kinds:
block functions
, which have a beginning and ending tag enclosing the text operated on by
the function, and
template functions
, which have just a single tag and do not enclose text.
To use a function, enclose the function name in curly braces { } and provide any attributes that may be required for
the function. Block functions also require a closing tag.
dump
{dump var=$value}