Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render twig macro in controller symfony 2

i can't figure out, how to render a macro in Symfony 2 controller. This is how i can render a twig template

$this
  ->get("twig")
  ->render("AcmeBundle:Product:table.html.twig", array(
    "product" => $product
  ))
;

So i searching for something similar, but for rendering a twig macro. Thx for any suggestions!

like image 271
PayteR Avatar asked Sep 15 '25 04:09

PayteR


1 Answers

Twig macro's are something inside a template. They are run whenever you render a template executing the macro.

like image 97
Wouter J Avatar answered Sep 16 '25 17:09

Wouter J