class Marten::Template::Tag::CsrfToken

Overview

The csrf_token template tag.

The csrf_token template tag allows to compute and insert the value of the CSRF token into a template. This tag requires the presence of a handler object in the template context (under the "handler" key), otherwise an empty token is returned.

Optionally, the output of this tag can be assigned to a specific variable using the as keyword:

{% csrf_token as my_var %}

Included Modules

Defined in:

marten/template/tag/csrf_token.cr

Constructors

Instance Method Summary

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

split_smartly(expression : String) : Array(String) split_smartly

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]