0.1.2 • Published 9 years ago
bootform v0.1.2
Generate forms from json objects.
Bootform takes a json object and treats it as a description of an html form.
Example:
{
"name":"MyForm",
"action": "/post",
"method": "post",
"controls": [{"type":"text"},{"type":"text"}]
}
The above json will create the following html:
<form class="form-horizontal " name="MyForm" action="/post" method="post">
<div class="form-group">
<div class="col-md-9 pull-right">
<input class="form-control" type="text" />
</div>
</div>
<div class="form-group">
<div class="col-md-9 pull-right">
<input class="form-control" type="text" />
</div>
</div>
</form>
Install
$ npm install --save bootform
Usage
var bootform = require('bootform').getInstance(pathToTemplates);
var html = bootform.parse(input);
$ npm install --global bootform
$ bootform --help
##Themes
Bootform comes with one default theme in the default
folder. To create
your own, you can follow the pattern in there.
License
MIT © Lasana Murray