I have created a twig file in sonata admin, where I want to show the preview of the another twig created using the sonata cms.
I found the use of render method to embed the controller action.
<div class="preview">
{{ render(controller('Bundle:Controller:action') }}
</div>
But the action takes an argument $contentDocument
public function Action($contentDocument, Request $request)
{
}
So how do I render this twig inside the preview div, to show a thumbnail to the user. Thank you