class Marten::Template::Tag::With
- Marten::Template::Tag::With
- Marten::Template::Tag::Base
- Reference
- Object
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.crConstructors
Instance Method Summary
-
#render(context : Context) : String
Render the template tag for a given context.
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
Instance Method Detail
Description copied from class Marten::Template::Tag::Base
Render the template tag for a given context.