Branching with if
, else if
, and else
#[derive(Oxiplate)]
#[oxiplate = "template.html.oxip"]
struct YourStruct {
count: i64,
}
print!("{}", YourStruct {
count: 19,
});
<p>
{%- if count < 0 -%}
{{ count }} is negative
{%- elseif count > 0 -%}
{{ count }} is positive
{%- else -%}
{{ count }} is zero
{%- endif -%}
</p>
<p>19 is positive</p>