Documentation
¶
Index ¶
- type Namespace
- func (ns *Namespace) CSS(i interface{}) (template.CSS, error)
- func (ns *Namespace) HTML(i interface{}) (template.HTML, error)
- func (ns *Namespace) HTMLAttr(i interface{}) (template.HTMLAttr, error)
- func (ns *Namespace) JS(i interface{}) (template.JS, error)
- func (ns *Namespace) JSStr(i interface{}) (template.JSStr, error)
- func (ns *Namespace) URL(i interface{}) (template.URL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace defines the methods for safe to be used as template functions.
func (*Namespace) CSS ¶
CSS
Returns a given string as html/template HTML content. Returns errors.TEMPLATE if the inputted interface failed to be cast.
Example: {{ "<p>verbis&cms</p>" | safeHTML }} Returns: `verbis&cms`
func (*Namespace) HTML ¶
HTML
Returns a given string as html/template HTML content Returns errors.TEMPLATE if the inputted interface failed to be cast.
Example: {{ "<p>verbis&cms</p>" | safeHTML }} Returns: `verbis&cms`
func (*Namespace) HTMLAttr ¶
HTMLAttr
Returns a given string as html/template HTMLAttr content. Returns errors.TEMPLATE if the inputted interface failed to be cast.
func (*Namespace) JS ¶
JS
Returns a given string as html/template HTML content. Returns errors.TEMPLATE if the inputted interface failed to be cast.
Example: {{ "(2*2)" | safeJS }} Returns: `(2*2)`
func (*Namespace) JSStr ¶
JSStr
Returns the given string as a html/template JSStr content. Returns errors.TEMPLATE if the inputted interface failed to be cast.
func (*Namespace) URL ¶
URL
Returns a given string as html/template URL content. Returns errors.TEMPLATE if the inputted interface failed to be cast.
Example: {{ "https://verbiscms.com" | safeUrl }} Returns: `https://verbiscms.com`