This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Listener; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | |
class LocaleListener { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% form_theme form _self %} | |
{% block checkbox_radio_label -%} | |
{# {% block _user_registration_form_termsAccepted_label %} - use this if you need it for just a single field, amend accordingly to your form type/field #} | |
{#- Do not display the label if widget is not defined in order to prevent double label rendering -#} | |
{%- if widget is defined -%} | |
{% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class) %} | |
{% set is_custom = label_attr.class is defined and ('checkbox-custom' in label_attr.class or 'radio-custom' in label_attr.class) %} | |
{%- if is_parent_custom or is_custom -%} | |
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' custom-control-label')|trim}) -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% form_theme form _self %} | |
{% block checkbox_widget -%} | |
{%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%} | |
{%- if 'checkbox-custom' in parent_label_class -%} | |
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' custom-control-input')|trim}) -%} | |
<div class="custom-control custom-checkbox{{ 'checkbox-inline' in parent_label_class ? ' custom-control-inline' }}"> | |
{{ block('checkbox_widget_base') }} | |
</div> | |
{%- else -%} |