== stencil ==

The first item in the array ref is used for both <code>id</code> and <code>name</code>. Except...

--input--
    %= formgroup 'Text test 1', text_field => ['test_text']
--end input--
--output--
    <div class="form-group">
        <label class="control-label" for="test_text">Text test 1</label>
        <input class="form-control" id="test_text" name="test_text" type="text" />
    </div>
--end output--


== stencil { to_pod => 0 } ==
--input--
    %= formgroup 'Text test 2', text_field => ['test_text', size => 30]
--end input--
--output--
    <div class="form-group">
        <label class="control-label" for="test_text">Text test 2</label>
        <input class="form-control" id="test_text" name="test_text" size="30" type="text" />
    </div>
--end output--


== stencil ==

...if the input name (the first item in the text_field array ref) contains dashes -- those are replaced (in the <code>name</code>) to underscores:

--input--
    %= formgroup 'Text test 4', text_field => ['test-text', large]
--end input--
--output--
    <div class="form-group">
        <label class="control-label" for="test-text">Text test 4</label>
        <input class="form-control input-lg" id="test-text" name="test_text" type="text" />
    </div>
--end output--





== stencil ==

An input with a value:

--input--
    %= formgroup 'Text test 5', text_field => ['test_text', '200' ]
--end input--
--output--
    <div class="form-group">
        <label class="control-label" for="test_text">Text test 5</label>
        <input class="form-control" id="test_text" name="test_text" type="text" value="200" />
    </div>
--end output--


== stencil ==

Note the difference with the earlier example. Here <code>large</code> is outside the <code>text_field</code> array reference, and therefore <code>.form-group-lg</code> is applied to the form group:

--input--
    <form class="form-horizontal">
        %= formgroup 'Text test 6', text_field => ['test_text'], large, cols => { small => [2, 10] }
    </form>
--end input--
--output--
    <form class="form-horizontal">
        <div class="form-group form-group-lg">
            <label class="control-label col-sm-2" for="test_text">Text test 6</label>
            <div class="col-sm-10">
                <input class="form-control" id="test_text" name="test_text" type="text">
            </div>
        </div>
    </form>
--end output--



== stencil { to_pod => 0 } ==
--input--
    %= formgroup text_field => ['test_text', xsmall] => begin
        Text test 7
    %  end
--end input--
--output--
    <div class="form-group">
        <label class="control-label" for="test_text"> Text test 7 </label>
        <input class="form-control input-xs" id="test_text" name="test_text" type="text" />
    </div>
--end output--



== stencil ==

A formgroup used in a <code>.form-horizontal</code> <code>form</code>:

(Note that in this context, <code>medium</code> and <code>large</code> are not shortcuts, but ordinary hash keys.)

--input--
    %= formgroup 'Text test 8', text_field => ['test_text'], cols => { medium => [2, 10], small => [4, 8] }
--end input--
--output--
    <div class="form-group">
        <label class="control-label col-md-2 col-sm-4" for="test_text">Text test 8</label>
        <div class="col-md-10 col-sm-8">
            <input class="form-control" id="test_text" name="test_text" type="text" />
        </div>
    </div>
--end output--


== stencil { to_pod => 0 } ==
--input--
    %= formgroup text_field => ['test-text-9']
--end input--
--output--
    <div class="form-group">
        <input class="form-control" id="test-text-9" name="test_text_9" type="text" />
    </div>
--end output--


== stencil { to_pod => 0 } ==
--input--
    %= formgroup 'Text test 9', text_area => ['atextarea', 'default text']
--end input--
--output--
    <div class="form-group">
        <label class="control-label" for="atextarea">Text test 9</label>
        <textarea class="form-control" id="atextarea" name="atextarea">default text</textarea>
    </div>
--end output--
Textareas can also be used in formgroups.


== stencil ==
--input--
    
--end input--
--output--
--end output--

