- NAME
- DESCRIPTION
- METHODS
- For nil
- For SCALARs
- For ARRAY references
- For HASH references
-.
Note that optional functions are defined in Text::Xslate::Bridge::Star.
METHODS
The xslate engine supports auto-boxing, so you can call methods for primitive (non-object) values. The following are builtin methods.
For nil
nil has its specific namespace as
nil, although no builtin methods are provided.
For SCALARs
The namespace of SCALARs is
scalar, although no builtin methods are provided.
For ARRAY references.
For HASH references}
$v must be a HASH reference..
For example, the following two statements are the same:
<: $value | foo :> <: foo($value) :>
Note that some builtin functions, such as
defined, are not a real function which you cannot use as a filter.
mark_raw($str)
Mark $str as a raw string to avoid auto HTML escaping. You'd better avoid to use this function. Instead, you should use the
mark_raw() subroutine in programs, which you can import from
Text::Xslate::Util.
raw is an alias to
mark_raw.
unmark_raw($str)
Remove the raw mark from $str. If $str is not a raw string, this function returns $str as is.
html_escape($str)
Escapes html meta characters in $str. If $str is a raw string, this function returns $str as is.
The html meta characters are
/[<>"'&]/.
html is an alias to
html_escape.
uri_escape($str)
Escapes unsafe URI characters in $str which gets encoded to UTF-8.
The unsafe URI characters are characters not included in the
unreserved character class defined by RFC 3986, i.e.
/[^A-Za-z0-9\-\._~]/.
uri is an alias to
uri_escape.
is_array_ref(($value)
Returns true if $value is an ARRAY reference.
is_hash_ref(($value)
Returns true if $value is a HASH reference.
dump($value)
Inspects $value with
Data::Dumper.
This function is provided for testing and debugging.
defined($value)
Returns true if $value is defined. This is not a real function, but an unary operator, so you can omit the parens like
defined $value.
SEE ALSO
Text::Xslate::Bridge::Star