helpers

package module
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 14 Imported by: 14

README

Helpers

Standard Test Go Reference


Note: This file is auto-generated. Do Not Edit

bootstrap#Form

Form implements a github.com/gobuffalo/plush helper around the bootstrap.New function in the github.com/gobuffalo/tags/form/bootstrap package

bootstrap#FormFor

FormFor implements a github.com/gobuffalo/plush helper around the bootstrap.NewFormFor function in the github.com/gobuffalo/tags/form/bootstrap package

bootstrap#New

New returns a map of the helpers within this package.

bootstrap#RemoteForm

RemoteForm implements a github.com/gobuffalo/plush helper around the bootstrap.New function in the github.com/gobuffalo/tags/form/bootstrap package

bootstrap#RemoteFormFor

FormFor implements a github.com/gobuffalo/plush helper around the bootstrap.NewFormFor function in the github.com/gobuffalo/tags/form/bootstrap package

<%= remoteFormFor(widget, {method: "POST"}) { %>
<% } %>
<form action="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91" id="widget-form" method="POST"><input name="_method" type="hidden" value="PUT"></form>

content#ContentFor

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>
<% } %>

content#ContentOf

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"}) %>

content#New

New returns a map of the helpers within this package.

content#WithDefault

WithDefault allows to get the value from a key in the context or a default value if not present.

debug#Debug

Debug by verbosely printing out using 'pre' tags.

debug#Inspect

Inspect the interface using the %+v formatter

debug#New

New returns a map of the helpers within this package.

encoders#New

New returns a map of the helpers within this package.

encoders#Raw

Raw converts a string to a template.HTML

encoders#ToJSON

ToJSON marshals the interface{} and returns it as template.HTML

env#New

New returns a map of the helpers within this package.

escapes#HTMLEscape

HTMLEscape will escape a string for HTML

escapes#New

New returns a map of the helpers within this package.

forms#Form

Form implements a github.com/gobuffalo/plush helper around the form.New function in the github.com/gobuffalo/tags/form package

forms#FormFor

FormFor implements a github.com/gobuffalo/plush helper around the form.NewFormFor function in the github.com/gobuffalo/tags/form package

forms#New

New returns a map of the helpers within this package.

forms#RemoteForm

RemoteForm implements a github.com/gobuffalo/plush helper around the form.New function in the github.com/gobuffalo/tags/form package

forms#RemoteFormFor

RemoteFormFor implements a github.com/gobuffalo/plush helper around the form.NewFormFor function in the github.com/gobuffalo/tags/form package

<%= remoteFormFor(widget, {method: "POST"}) { %>
<% } %>
<form action="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91" id="widget-form" method="POST"><input name="_method" type="hidden" value="PUT"></form>

inflections#New

New returns a map of the helpers within this package.

iterators#Between

Between will iterate up to, but not including b

Between(0,10) // 0,1,2,3,4,5,6,7,8,9

iterators#GroupBy

GroupBy creates an iterator of groups or sub-slices of the underlying Array or Slice entered where each group is of length Len(underlying) / size. If Len(underlying) == size it will return an iterator with only a single group.

iterators#New

New returns a map of the helpers within this package.

iterators#Next

Next returns the next group from the GroupBy

iterators#Next

Next returns the next number in the Range or nil

iterators#Range

Range creates an Iterator that will iterate numbers from a to b, including b.

iterators#Until

Until will iterate up to, but not including a

Until(3) // 0,1,2

meta#Len

Len returns the length of v

meta#New

New returns a map of the helpers within this package.

paths#New

New returns a map of the helpers within this package.

paths#PathFor

PathFor takes an interface{}, or a slice of them, and tries to convert it to a /foos/{id} style URL path. Rules:

  • if string it is returned as is
  • if Pathable the ToPath method is returned
  • if slice or an array each element is run through the helper then joined
  • if struct the name of the struct, pluralized is used for the name
  • if Paramable the ToParam method is used to fill the {id} slot
  • if struct.Slug the slug is used to fill the {id} slot of the URL
  • if struct.ID the ID is used to fill the {id} slot of the URL

tags#CSS

CSS creates html for a css link using github.com/gobuffalo/tags to create a link with the given options and href. Defaults to stylesheet for rel and screen for media if those options are not set.

tags#Img

Img creates html for a <img> tag using github.com/gobuffalo/tags to create a tag with the given src and options.

tags#JS

JS creates html for a <script> tag using github.com/gobuffalo/tags to create the tag with the given options and src. Defaults to text/javascript for type if not set in the options.

tags#LinkTo

LinkTo creates html for a <a> tag using github.com/gobuffalo/tags to create tag with the given options(opts) and using paths#PathFor(in) to set the href. If given a block it will be interrupted and appended inside of the <a> tag. Example 1:

<%= linkTo([user, widget], {class: "btn"}) %>

yields(assuming user ID'd by id and widget by slug):

<a class="btn" href="/users/id/widget/slug"></a>

Example 2:

<%= linkTo("foo", {class: "btn"}) %>

yields:

<a class="btn" href="/foo"></a>

tags#New

New returns a map of the helpers within this package.

tags#RemoteLinkTo

RemoteLinkTo creates an AJAXified <a> tag.

<%= remoteLinkTo(widget, {class: "btn btn-info", body: "View"}) %>
<a class="btn btn-info" data-remote="true" href="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91">View</a>

text#Markdown

Markdown converts the string into HTML using GitHub flavored markdown.

text#New

New returns a map of the helpers within this package.

text#Truncate

Truncate will try to return a string that is no longer than size, which defaults to 50. If given a trail option the returned string will have that appended at the end, while still trying to make sure that the returned string is no longer than size characters long. However, if trail is longer than or equal to size, trail will be returned completely as is. Defaults to a trail of ....

Documentation

Index

Constants

View Source
const Version = "v0.6.7"

Version of helpers

Variables

View Source
var BootstrapForms = bootstrap.New()
View Source
var Content = content.New()
View Source
var Debug = debug.New()
View Source
var Encoders = encoders.New()
View Source
var Env = env.New()
View Source
var Escapes = escapes.New()
View Source
var Forms = forms.New()
View Source
var Inflections = inflections.New()
View Source
var Iterators = iterators.New()
View Source
var Meta = meta.New()
View Source
var Paths = paths.New()
View Source
var Tags = tags.New()
View Source
var Text = text.New()

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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