I’m looking to use the pretty sql formatter that is included as a library with symfony2. To output some sql’s on the template page.
formatter is included here
/vendor/jdorn/sql-formatter/lib/SqlFormatter.
I would pass it into the twig template
PageController.php
$queryBaseSQL = "SELECT * FROM exampleTable WHERE 'this' = 1 ";
return $this->render('sjQueryBundle:Page:index.html.twig', array(
'queryBaseSQL' => $queryBaseSQL
));
I was hoping to be able to call it inside twig something like where
(index.html.twig)
{{ sqlFormatter::format(queryBaseSQL) }}
Twig: