helpers: github.com/gobuffalo/helpers/content Index | Files

package content

import "github.com/gobuffalo/helpers/content"

Index

Package Files

content.go for.go of.go

Constants

const (
    OfKey  = "contentOf"
    ForKey = "contentFor"
)

Keys to be used in templates for the functions in this package.

func ContentFor Uses

func ContentFor(name string, help hctx.HelperContext)

ContentFor stores a block of templating code to be re-used later in the template via the contentOf helper. An optional map of values can be passed to contentOf, which are made available to the contentFor block.

<% contentFor("buttons") { %>
	<button>hi</button>
<% } %>

func ContentOf Uses

func ContentOf(name string, data hctx.Map, help hctx.HelperContext) (template.HTML, error)

ContentOf retrieves a stored block for templating and renders it. You can pass an optional map of fields that will be set.

<%= contentOf("buttons") %>
<%= contentOf("buttons", {"label": "Click me"}) %>

func New Uses

func New() hctx.Map

New returns a map of the helpers within this package.

Package content imports 3 packages (graph) and is imported by 1 packages. Updated 2019-07-05. Refresh now. Tools for package owners.