Form-fields Tag
To be used within the form:create tag when dynamically rendering fields.
Example
This tag can recursively loop over the fields
array context provided within the form:create tag pair.
{{ form:fields }}
<div class="p-2">
<label>{{ display }}</label>
<div class="p-1">{{ field }}</div>
{{ if error }}
<p class="text-gray-500">{{ error }}</p>
{{ /if }}
</div>
{{ /form:fields }}
<s:form:fields>
<div class="p-2">
<label>{{ $field['display'] }}</label>
<div class="p-1">{{ $field['field'] }}</div>
@if ($field['error'])
<p class="text-gray-500">{{ $field['error'] }}</p>
@endif
</div>
</s:form:fields>
Parameters
get
string
Get and render one specific field by its handle.
only
string
Loop over only the specified field handles (pipe separated).
except
string
Loop over all except the specified field handles (pipe separated).
Docs Feedback
Submit improvements, related content, or suggestions through Github.
Betterify this page