Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Twig][Form] Twig theme for Foundation 6 #34880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 2 src/Symfony/Bridge/Twig/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ CHANGELOG
* removed `transChoice` filter and token
* `HttpFoundationExtension` requires a `UrlHelper` on instantiation
* removed support for implicit STDIN usage in the `lint:twig` command, use `lint:twig -` (append a dash) instead to make it explicit.
* added form theme for Foundation 6
* added support for Foundation 6 switches: add the `switch-input` class to the attributes of a `CheckboxType`

4.4.0
-----
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% extends "form_div_layout.html.twig" %}

{%- block checkbox_row -%}
{%- set parent_class = parent_class|default(attr.class|default('')) -%}
{%- if 'switch-input' in parent_class -%}
{{- form_label(form) -}}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' switch-input')|trim}) -%}
{{- form_widget(form) -}}
<label class="switch-paddle" for="{{ form.vars.id }}"></label>
{{- form_errors(form) -}}
{%- else -%}
{{- block('form_row') -}}
{%- endif -%}
{%- endblock checkbox_row -%}

{% block money_widget -%}
{% set prepend = not (money_pattern starts with '{{') %}
{% set append = not (money_pattern ends with '}}') %}
{% if prepend or append %}
<div class="input-group">
{% if prepend %}
<span class="input-group-label">{{ money_pattern|form_encode_currency }}</span>
{% endif %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' input-group-field')|trim}) %}
{{- block('form_widget_simple') -}}
{% if append %}
<span class="input-group-label">{{ money_pattern|form_encode_currency }}</span>
{% endif %}
</div>
{% else %}
{{- block('form_widget_simple') -}}
{% endif %}
{%- endblock money_widget %}

{% block percent_widget -%}
{%- if symbol -%}
<div class="input-group">
{% set attr = attr|merge({class: (attr.class|default('') ~ ' input-group-field')|trim}) %}
{{- block('form_widget_simple') -}}
<span class="input-group-label">{{ symbol|default('%') }}</span>
</div>
{%- else -%}
{{- block('form_widget_simple') -}}
{%- endif -%}
{%- endblock percent_widget %}

{% block button_widget -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' button')|trim}) %}
{{- parent() -}}
{%- endblock button_widget %}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.