Display php code (as string) from twig variable in Symfony application

my first question on stackoverflow 🙂

I’m developing an application with Symfony 5.2 and wish to be able to save code snippets in bdd (mySql with phpmyadmin) containing php in order to display it as one would display a sample code in a documentation (e.g. PHP or Symfony doc). But this doesn’t seem to work unless I remove the <?php tags ?>, which is not always desirable in the context of my activity.

  • Problem of configuration with my local server (Symfony Local Web
    Server
    )?
  • Problem with Twig?
  • Tip unknown to me?

Thanks in advance.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *