dox Executable Documentation

Array field

Wrap name of inner field

Given and array field 'tests' of string fields 'test'
When I render the field
Then the output should contain 'args[tests][]'

Strip labels and ids

Given and array field 'tests' of string fields 'test'
When I render the field
Then the output should not contain '<label for="test"'
Then the output should not contain 'id="test"'

Render

Given and array field 'tests' of string fields 'test'
When I render the field
Then the output should be ' <label for="tests">Tests</label> <div id="tests"></div> <button class="btn btn-default" type="button" onclick="document.getElementById(\'tests\').appendChild(document.getElementById(\'tests-inner\').lastChild.cloneNode(true)); return false;">Add</button> <div id="tests-inner" style="display: none"><div> <input class="form-control" type="text" name="args[tests][]"/> </div></div>'