class Marten::Template::Node::Tag

Overview

Represents a tag node.

A tag node will be resolved based on the current context in order to produce the final output. Tag nodes are initialized from a source string that corresponds to the tag usage and from the parser (Marten::Template::Parser object) that initiated their initializations. This is because tag nodes can trigger the parsing of possible inner nodes, up to the a closing tag (for example {% if ... %} up to {% endif %}).

Defined in:

marten/template/node/tag.cr

Constructors

Instance Method Summary

Instance methods inherited from class Marten::Template::Node::Base

render(context : Context) : String render

Constructor Detail

def self.new(parser : Parser, source : String) #

[View source]

Instance Method Detail

def render(context : Context) : String #

Returns the string representation of the tag node for a given context.


[View source]

Returns the tag instance initialized for the current node.


[View source]