Reputation: 1468
can I customize widget name for Form in symfony ? I want to customize a widget in Twig, but my form is called in others entity and this name is always changed ...
Exemple :
I have three entity
I have two forms :
But I want to customize C block in twig.
In A form page, widget name is " {% block A_C_widget %} " and in B form page, widget name is " {% block B_C_widget %} ".
I want a same name, it's possible ?
Upvotes: 0
Views: 814
Reputation: 383
You can use that:
// ...
$builder->add('name', CTYpe::class, array(
'block_name' => 'your_desire_name_here',
));
So, when rendering, it will be called your_desire_name_here_widget
Upvotes: 2