php - Display twig code written in a twig file -
i writting tutorial , need display twig code... problem: i'm writting twig code on twig view, need find way write raw, without interpretation.
currently, using twig extension job:
$path = $this->kernel->locateresource($path, null, true); return file_get_contents($path);
but i'm wondering if there better solutions.
found it. twig has built-in tag to job : verbatim.
{% verbatim %} <ul> {% item in seq %} <li>{{ item }}</li> {% endfor %} </ul> {% endverbatim %}
Comments
Post a Comment