Gaylord.P
Gaylord.P

Reputation: 1468

Customize block form in Twig

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 :

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

Answers (1)

Muriano
Muriano

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

Related Questions