In my edit.html.twig, I have:
{% form_theme edit_form 'MyBundle:Entity:form.html.twig' %} {% set img_src = asset('120x100.jpg') %} {{ dump(img_src) }} {{ dump(entity) }} {{ form_widget(edit_form, {'form_type': 'horizontal', 'img_src': img_src }) }}
I have img_src and an entity , no problem.
In form.html.twig, I have:
{% extends 'MyBundle:Form:bootstrap.html.twig' %} {% block _entity_field_widget %} {{ dump(img_src) }} {{ dump(entity) }} {% set type = 'hidden' %} {{ block('form_widget_simple') }} {% endblock _channel_media_widget %}
bootstrap.html.twig is just a boot file * form_div_layout.html.twig *
And in this widget I don't have img_src or entity .
Any ideas on how to get an object in widgets? Should it be passed to form a widget or is there another way? What am I doing wrong?
CRONUS
source share