Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork12
License
gobuffalo/helpers
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Form implements agithub.com/gobuffalo/plush helper around thebootstrap.New function in thegithub.com/gobuffalo/tags/form/bootstrap package
FormFor implements agithub.com/gobuffalo/plush helper around thebootstrap.NewFormFor function in thegithub.com/gobuffalo/tags/form/bootstrap package
New returns a map of the helpers within this package.
RemoteForm implements agithub.com/gobuffalo/plush helper around thebootstrap.New function in thegithub.com/gobuffalo/tags/form/bootstrap package
FormFor implements agithub.com/gobuffalo/plush helper around thebootstrap.NewFormFor function in thegithub.com/gobuffalo/tags/form/bootstrap package
<%= remoteFormFor(widget, {method: "POST"}) { %><% } %><form action="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91" method="POST"><input name="_method" type="hidden" value="PUT"></form>ContentFor stores a block of templating code to be re-used later in the templatevia 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><% } %>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"}) %>New returns a map of the helpers within this package.
WithDefault allows to get the value from a key in the context or a default value if not present.
Debug by verbosely printing out using 'pre' tags.
Inspect the interface using the%+v formatter
New returns a map of the helpers within this package.
New returns a map of the helpers within this package.
Raw converts astring to atemplate.HTML
ToJSON marshals the interface{} and returns itas template.HTML
New returns a map of the helpers within this package.
HTMLEscape will escape a string for HTML
New returns a map of the helpers within this package.
Form implements agithub.com/gobuffalo/plush helper around theform.New function in thegithub.com/gobuffalo/tags/form package
FormFor implements agithub.com/gobuffalo/plush helper around theform.NewFormFor function in thegithub.com/gobuffalo/tags/form package
New returns a map of the helpers within this package.
RemoteForm implements agithub.com/gobuffalo/plush helper around theform.New function in thegithub.com/gobuffalo/tags/form package
RemoteFormFor implements agithub.com/gobuffalo/plush helper around theform.NewFormFor function in thegithub.com/gobuffalo/tags/form package
<%= remoteFormFor(widget, {method: "POST"}) { %><% } %><form action="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91" method="POST"><input name="_method" type="hidden" value="PUT"></form>New returns a map of the helpers within this package.
Between will iterate up to, but not includingb
Between(0,10) // 0,1,2,3,4,5,6,7,8,9GroupBy creates an iterator of groups or sub-slices of the underlyingArray or Slice entered where each group is of lengthLen(underlying) / size. If Len(underlying) == size it willreturn an iterator with only a single group.
New returns a map of the helpers within this package.
Next returns the next group from the GroupBy
Next returns the next number in the Range or nil
Range creates an Iterator that williterate numbers from a to b, including b.
Until will iterate up to, but not includinga
Until(3) // 0,1,2Len returns the length of v
New returns a map of the helpers within this package.
New returns a map of the helpers within this package.
PathFor takes aninterface{}, or aslice of them,and tries to convert it to a/foos/{id} style URL path.Rules:
- if
stringit is returned as is - if
PathabletheToPathmethod is returned - if
sliceor anarrayeach element is run through the helper then joined - if
structthe name of the struct, pluralized is used for the name - if
ParamabletheToParammethod is used to fill the{id}slot - if
struct.Slugthe slug is used to fill the{id}slot of the URL - if
struct.IDthe ID is used to fill the{id}slot of the URL
CSS creates html for a css link usinggithub.com/gobuffalo/tagsto create a link with the given options and href. Defaultstostylesheet forrel andscreen formedia if thoseoptions are not set.
Img creates html for a<img> tag usinggithub.com/gobuffalo/tagsto create a tag with the givensrc andoptions.
JS creates html for a<script> tag usinggithub.com/gobuffalo/tagsto create the tag with the givenoptions andsrc. Defaultstotext/javascript fortype if not set in theoptions.
LinkTo creates html for a<a> tag usinggithub.com/gobuffalo/tagsto create tag with the given options(opts) andusingpaths#PathFor(in) to set thehref. If given a blockit will be interrupted and appended inside of the<a> tag.Example 1:
<%= linkTo([user, widget], {class: "btn"}) %>yields(assuming user ID'd byid and widget byslug):
<a href="/users/id/widget/slug"></a>Example 2:
<%= linkTo("foo", {class: "btn"}) %>yields:
<a href="/foo"></a>New returns a map of the helpers within this package.
RemoteLinkTo creates an AJAXified<a> tag.
<%= remoteLinkTo(widget, {class: "btn btn-info", body: "View"}) %><a data-remote="true" href="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91">View</a>Markdown converts the string into HTML using GitHub flavored markdown.
New returns a map of the helpers within this package.
Truncate will try to return a string that is no longerthansize, which defaults to 50. If givenatrail option the returned string will havethat appended at the end, while still trying to makesure that the returned string is no longer thansize characters long. However, iftrail is longerthan or equal tosize,trail will be returnedcompletely as is. Defaults to atrail of....
About
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors10
Uh oh!
There was an error while loading.Please reload this page.