kai-jacobsen/kontentblocks

View on GitHub
core/Fields/Definitions/templates/checkboxset/default.twig

Summary

Maintainability
Test Coverage
{% extends Form.getLayout() %}
{% block fieldmarkup %}
    {% for o in Field.getArg('options') %}
        {% if (o.key and o.name and o.value) %}
            <div class='kb-checkboxset-item'>
                <label>
                    <input type='checkbox' id='{{ Form.getInputFieldId() }}' name='{{ Form.getFieldName(false, o.key) }}'
                           value='{{ o.value }}'
                            {% if o.value == value[o.key] %} checked="checked" {% endif %}/>{{ o.name }}</label></div>

        {% else %}
            <p>Invalid option. Key,name or value missing.</p>
        {% endif %}


    {% endfor %}
{% endblock %}