driver to show contents of the database in symfony3? [closed]

0

Hello I have saved in the database, complete html codes, I need a controller to show the result of the code in a new page.

    
asked by Jra 11.12.2018 в 14:07
source

1 answer

0

You retrieve the content in the contractor in a variable as a text string:

$html=$em->getRepository('MyEntityRepository')->findOne();

Then you pass it as a parameter when you render the new page in the controller.

return $this->render('ruta a la pagina/nueva_pagina.html.twig',['html'=>$html]);

Then you render it on the page with twig.

<!DOCTYPE html>
<html>
    <body>
        {{ html }}
    </body>
</html>
    
answered by 11.12.2018 / 17:13
source