tplctx

package
v0.0.0-...-8fa2440 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tplctx provides basic amenities to be provided to templates as a context object. It may be composed to provide further methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ctx

type Ctx struct {
	Req *http.Request
}

Context functions for use in templates.

func (*Ctx) AC

func (c *Ctx) AC(action string) string

Generate an action code for the given action. If action is "", the current path is used.

func (*Ctx) AssetIntegrity

func (c *Ctx) AssetIntegrity(path string) string

func (*Ctx) AssetURL

func (c *Ctx) AssetURL(path string) string

func (*Ctx) CSPNonce

func (c *Ctx) CSPNonce() string

func (*Ctx) Fields

func (c *Ctx) Fields(f interface{}) *pongo2.Value

func (*Ctx) Flash

func (c *Ctx) Flash() []session.Flash

Get flash messages. The flash messages are erased.

func (*Ctx) IsAdmin

func (c *Ctx) IsAdmin() bool

Returns true iff user is an administrator.

func (*Ctx) IsDevMode

func (c *Ctx) IsDevMode() bool

Is application running in dev mode?

func (*Ctx) IsLoggedIn

func (c *Ctx) IsLoggedIn() bool

Returns true iff user is logged in.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL