class Crinja::Tag::If

Overview

The if tag is a conditional statement. The block content will only be evaluated if the test condition is truthy. Condition can be an arbitrary Expression. elif and else allow for multiple branches.

{% if kenny.sick %}
  Kenny is sick.
{% elif kenny.dead %}
  You killed Kenny!  You bastard!!!
{% else %}
  Kenny looks okay --- so far
{% endif %}

See Jinja2 Template Documentation for details.

Defined in:

lib/tag/if.cr

Instance Method Summary

Instance methods inherited from class Crinja::Tag

end_tag : String? end_tag, has_block?(node : TagNode) has_block?, interpret_output(renderer : Renderer, tag_node : TagNode) interpret_output, to_s(io) to_s

Instance Method Detail

def end_tag : String? #

[View source]
def evaluate_node(tag_node, env : Crinja) #

[View source]
def name : String #

[View source]