class Marten::Template::Tag::With

Overview

The with template tag.

The with template tag allows to assign local variables inside a block. After the block is done the assigned variables are no longer available. block:

{% with var1=2(, var2="Hello World") %}
  {{ var1 }} {{ var2 }}
{% endwith %}

Included Modules

Defined in:

marten/template/tag/with.cr

Constructors

Instance Method Summary

Instance methods inherited from module Marten::Template::Tag::CanExtractAssignments

extract_assignments(source : String) extract_assignments

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

render(context : Context) : String render

Constructor methods inherited from class Marten::Template::Tag::Base

new(parser : Parser, source : String) new

Constructor Detail

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

[View source]

Instance Method Detail

def render(context : Context) : String #
Description copied from class Marten::Template::Tag::Base

Render the template tag for a given context.


[View source]