EC System

Form groups

{#
  Parameters:
    - "content" (string) (default: '')
    - "extra_classes" (string) (default: '')
    - "extra_attributes" (array) (default: []): format: [
        {
          "name" (string) (default: ''),
          "value" (string) (default: '')
        },
        ...
      ]
  Blocks:
    - "form_group": main content
#}

{# Internal properties #}

{% set _css_class = 'ecl-form-group' %}
{% set _extra_attributes = '' %}
{% set _content = content|default('') %}

{# Internal logic - Process properties #}

{% if extra_classes is defined and extra_classes is not empty %}
  {% set _css_class = _css_class ~ ' ' ~ extra_classes %}
{% endif %}

{% if extra_attributes is defined and extra_attributes is not empty and extra_attributes is iterable %}
  {% for attr in extra_attributes %}
    {% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name ~ '="' ~ attr.value|e ~'"' %}
  {% endfor %}
{% endif %}

{# Print the result #}

<div class="{{ _css_class }}"{{ _extra_attributes }}>
  {% block form_group _content %}
</div>
/* No context defined for this component. */
<div class="ecl-form-group">
</div>
  • Content:
    /**
     * Form Group
     * @define form-group
     */
    
    // Import base and generic
    @import '@ecl/ec-base/ec-base';
    @import '@ecl/generic-component-form-form-group/generic-component-form-form-group';
    
    // Use generic mixin
    @include exports('ec-component-form-form-group') {
      @include ecl-form-group();
    }
    
  • URL: /components/raw/ec-component-form-form-group/ec-component-form-form-group.scss
  • Filesystem Path: ../../src/systems/ec/ec-component/ec-component-form/ec-component-form-form-group/ec-component-form-form-group.scss
  • Size: 292 Bytes
  • Handle: @ecl/ec-component-form-form-group
  • Tags: atom
  • Preview:
  • Filesystem Path: ../../src/systems/ec/ec-component/ec-component-form/ec-component-form-form-group/ec-component-form-form-group.twig