The Special `@` character

Phoenix uses a single character to differentiate between HTML and Java code: @. Anywhere you want to insert tinamic content, prepend the @ character and you are set to go. This applies for any content block and can even be used to print variable values.

If you need to print the @ character inside your HTML page you will need to escape it. This is done using, you guessed it, the @ character. So, for example, an email will look like this: testEmail@@example.com

Here are a few examples of using the @ character. There are many more elements supported by Phoenix, so head over to the dedicated page for each to read more.

                        
@import java.util.List;

<h6>@title</h6>

<p>
    Operation: @a + @b = @(a + b)
</p>

<a href="@(pageName).html">URL to the page</a>

@for (String item:items) {
<span>@item</span>
}