src/components/elements/form
// src/components/elements/form/schema.yaml
$schema: http://json-schema.org/draft-07/schema#
$id: /elements/form
additionalProperties: false
required:
- children
- method
- action
properties:
attributes:
type: string
children:
type: string
format: html
method:
type: string
action:
type: string
format: uri-reference
// src/components/elements/form/mocks.yaml
method: GET
action: action
children:
$render:
- $tpl: elements/form-element
$ref: elements/form-element#input
- $tpl: elements/form-element
$ref: elements/form-element#select
- $tpl: elements/options
$ref: elements/options#row
- $tpl: elements/form-element
$ref: elements/form-element#textarea
- $tpl: elements/form-element
$ref: elements/form-element#checkbox
- $tpl: elements/form-element
$ref: elements/form-element#submit
// src/components/elements/form/form.twig
<form{{ attributes }} method="{{ method }}" action="{{ action }}" class="Form {{ classes|join(" ") }}">
{{ children }}
</form>
default mock data
method: GET
action: action
children:
$render:
- $tpl: elements/form-element
$ref: elements/form-element#input
- $tpl: elements/form-element
$ref: elements/form-element#select
- $tpl: elements/options
$ref: elements/options#row
- $tpl: elements/form-element
$ref: elements/form-element#textarea
- $tpl: elements/form-element
$ref: elements/form-element#checkbox
- $tpl: elements/form-element
$ref: elements/form-element#submit