{#
# This file is part of the CSSettingsBundle package.
#
# (c) Pierre du Plessis <info@customscripts.co.za>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#}

{% macro settings_section(section, settings, form) %}

    {% set form_extras %}
        {% for parent, setting in settings %}
            {% if setting is iterable %}
                {{ _self.settings_section(parent, setting, form[section]) }}
            {% endif %}
        {% endfor %}
    {% endset %}

    {% if not form[section].rendered %}
        <legend>
        {{ section|title }}
        </legend>

        {{ form_widget(form[section]) }}
    {% endif %}

    {{ form_extras }}

{% endmacro %}

{#
# This file is part of the CSSettingsBundle package.
#
# (c) Pierre du Plessis <info@customscripts.co.za>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#}

{% macro settings_section(section, settings, form) %}

    {% set form_extras %}
        {% for parent, setting in settings %}
            {% if setting is iterable %}
                {{ _self.settings_section(parent, setting, form[section]) }}
            {% endif %}
        {% endfor %}
    {% endset %}

    {% if not form[section].rendered %}
        <legend>
        {{ section|replace({"_" : " "})|title }}
        </legend>

        {{ form_widget(form[section]) }}
    {% endif %}

    {{ form_extras }}

{% endmacro %}

Replace underscores when displaying sections
Replace underscores when displaying sections
