Skip to content

Commit

Permalink
Adding form builder docs to the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Danzabar committed Nov 6, 2015
1 parent 1a24085 commit d3524f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ The following is a basic example of how to set up and use a go form

form.addField(uname)

### YAML Form builder
You can create a yaml file to represent a form, passing this to builder will create a form with all its fields and validation rules specified, firstly you'll need to make a yaml form file, take a look at example.yml in the source code, after this pass it to the builder:

// Create a new builder
b := NewBuilder("example.yml", http.Request)
// Now the form can be built
b.build()

// Once the form is built you can access it through the builder
b.Form
b.Form.validate()

### Output
The form struct will output the form tags, and each field can output the Html representation of itself, for example

Expand Down

0 comments on commit d3524f0

Please sign in to comment.