Steven Mercatante
Steven Mercatante

Reputation: 25295

What's the best way to include custom HTML in a Symfony form?

I'm working with a Symfony generated admin and need to include some custom HTML into a form. This HTML (a label, img tag, and link) should only appear when the action is 'edit'. What's the best way to do this? It seems like I should just be able to include a partial, but I don't know where to include it from. Thanks.

Upvotes: 0

Views: 477

Answers (2)

samsam
samsam

Reputation: 201

Depending on the functionality you want the partial to have you could also write a custom widget and use your custom widget instead of the standard symfony one. (I use this for a widget wich displays me various sizes of images after a file upload)

Upvotes: 1

Steven Mercatante
Steven Mercatante

Reputation: 25295

I think I found the solution: I created a partial and set it to display within the moduel's generator.yml file (in the 'edit' section)

Upvotes: 0

Related Questions