Sponsored Link

Output variables

Output value of variable.
If val_name is a multidimensional array, you write the element name separated by ARRAY_DELIMITER.

String surrounded by '!{{' and '}}!' will be output as it is not interpreted as a tag of the template.

Syntax

{{ val_name }}

PHP

$assign['sample_echo1'] = 'default escape ( \' " < > & )';
$assign['sample_echo2'] = 'not escape ( \' " < > & )';
$assign['sample_echo3'] = 'http://example.com/';
$assign['sample_echo4'] = 'http://example.com/';
$assign['sample_echo5'] = "Line1
Line2 In PHP you write like \"\n\" instead of '\n'";
$assign['sample_echo6'] = array('key of array is numeric', 'In multidimensional array, separate element names with const::ARRAY_DELIMITER');
$assign['sample_echo7']['a7'] = 'key of array is string';
$assign['sample_echo8'] = "');alert(document.location+'";
$assign['sample_echo9'] = "s a m p l e";
$assign['sample_echo10'] = "ssa    mple";
$assign['is'] = "dummy";

Template

{{ sample_echo1 }}<br>
{{ sample_echo2|raw }}<br>
{{ sample_echo3|url }}<br>
{{ sample_echo4|urlpathinfo }}<br>
{{ sample_echo5|nl2br }}<br>
{{ sample_echo6.0 }} {{ sample_echo6.1 }}<br>
{{ sample_echo7.a7 }}<br>
JavaScript escape (alert as a string) :<input type="button" value="echo 8" onclick="javascript:alert('{{ sample_echo8|js }}');"><br>
HTML escape (alert as document.location):<input type="button" value="echo 8" onclick="javascript:alert('{{ sample_echo8|html }}');"><br>
{{ sample_echo9|nbsp }}<br>
{{ sample_echo10|tab2nbsp }}<br>
!{{ this {{ is }} literal }}!<br>

Result

default escape ( ' " < > & )
not escape ( ' " < > & )
http%3A%2F%2Fexample.com%2F
http%3A//example.com/
Line1
Line2 In PHP you write like "\n" instead of '\n'
key of array is numeric In multidimensional array, separate element names with const::ARRAY_DELIMITER
key of array is string
JavaScript escape (alert as a string) :
HTML escape (alert as document.location) :
s a m p l e
ssa mple
this {{ is }} literal