{! Most of the following code is from https://quarkus.io/guides/qute-reference !} {! Example html !} Report {now}

Report {now}

{#for sample in samples}

{sample.name ?: 'Unknown'}

{#if sample.valid} {sample.data} {myObject.myValue} {#else} Invalid sample found. {/if}

{/for} First name: First name: {! Expression !} simple properties: {foo}, {item.name} virtual methods: {item.get(name)}, {name ?: 'John'} with namespace: {inject:colors}. {! Section tag !} {#if foo}{foo.name}{/if}, the name in the closing tag is optional: {#if active}ACTIVE!{/}, can be empty: {#myTag image=true /}, may declare nested section blocks: {#if item.valid} Valid. {#else} Invalid. {/if} and decide which block to render. {! 2.1.1.1. Current Context !} {#each items} {count}. {it.name} {/each} {! Another form of iteration... !} {#for item in items} {count}. {item.name} {/for} {item.name} {! 2.1.2. Sections !} {#if item.name is 'sword'} It's a sword! {#else if item.name hello is 'shield'} It's a shield! {#else} Item is neither a sword nor a shield. {/if} {! 2.1.2.1. Loop Section !} {#each items} {it.name} {/each} {#for item in items} {item.name} {/for} {#each items} {count}. {it.name} {/each} {! 2.1.2.2. If Section !} {#if item.active} This item is active. {/if} {#if item.age > 10} This item is very old. {/if} {#if item.age > 10} This item is very old. {#else if item.age > 5} This item is quite old. {#else if item.age > 2} This item is old. {#else} This item is not old at all! {/if} {#if item.age eq 10} This item is 10 years old {/if} {#if item.age ne 10} This item is not 10 years old {/if} {#if item.age gt 10} This item is greater than 10 years old {/if} {#if item.age ge 10} This item is greater than or equal to 10 years old {/if} {#if item.age lt 10} This item is less than 10 years old {/if}

{title}

Hello {foo.message}! {#if item.age le 10} This item is less than or equal to 10 years old {/if} {! 2.1.2.3. With Section !} {#with item.parent} {name} {/with} {#with item.parent as myParent} {myParent.name} {/with} {! 2.1.2.4. Include/Insert Sections !} {#insert title}Default Title{/} {#insert body}No body!{/} {#include base} {#title}My Title{/title} {#body}
My body.
{/include} {! 2.1.2.5. User-defined Tags !} {#if showImage} {it.image} {/if} {! 3.1. Injecting Beans Directly In Templates !} {inject:foo.price} {! 3.2. Parameter Declarations !} {@org.acme.Foo foo} Qute Hello

{title}

Hello {foo.message}! {! Qute grammar highlighting works in html tags and strings !}
First name: