# Echoing text or data There is two token groups that you can use to print content into a view, `echo` or `print`. Escaped by default : `{% echo $argument %}` = `{{ $argument }}` = `{% print $argument %}` Raw when needed: `{% echo.raw $argument %}` = `{{= $argument }}` = `{% print.raw $argument %}` ## Outputing content to a view using `echo` / `{{ }}` / `print`, `echo.raw` / `{{= }}` / `print.raw` Using `print` or `echo`, which are, by default, made safer by using PHP's native `htmlspecialchars`. **[PICEA]** So, using this code: ```html {{ "Hello World !" }} {% echo "This is another way to output content" %} {% print "This is the third way to output content" %}
{% echo.raw $someHTML %} {% print.raw $someOtherHTML %} {{= $someMoreHTML }} ``` **[PHP]** Would yield internally: ```html
``` ## Using string format variant `printf` / `printf.raw` Those tokens represents the equivalent of the printf() function from PHP. **[PICEA]** So, using this code: ```html {% php $num = 5; $location = 'tree'; %} {% printf 'There are %d monkeys in the %s', $num, $location %} {% printf.raw 'There are %d monkeys in the %s', $num, $location %} ``` **[PHP]** Would render internally as : ```html ```