File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Studio24 \AccessibleForms \FieldTypes ;
4+
5+ use Symfony \Component \Form \AbstractType ;
6+ use Symfony \Component \Form \FormInterface ;
7+ use Symfony \Component \Form \FormView ;
8+ use Symfony \Component \OptionsResolver \OptionsResolver ;
9+ use Twig \Markup ;
10+
11+ class Html extends AbstractType
12+ {
13+ public function configureOptions (OptionsResolver $ resolver )
14+ {
15+ $ resolver ->setDefaults ([
16+ 'html ' => null ,
17+ 'view ' => null
18+ ]);
19+ }
20+
21+ public function buildView (FormView $ view , FormInterface $ form , array $ options )
22+ {
23+ $ view ->vars ['html ' ] = $ options ['html ' ];
24+
25+ // Load in template as Twig\Markup object.
26+ if (!empty ($ options ['view ' ])) {
27+ $ view ->vars ['html ' ] = new Markup ($ options ['view ' ], 'UTF-8 ' );
28+ }
29+ }
30+ }
Original file line number Diff line number Diff line change 221221 {{ block (' attributes' ) }}
222222{%- endblock widget_attributes -%}
223223
224+ {# Custom HTML block #}
225+ {%- block html_row -%}
226+ {{ html }}
227+ {%- endblock -%}
228+
229+
You can’t perform that action at this time.
0 commit comments