Full example for adding an existing Twig Extension to Laravel8 +TwigBridge?
Closed this issue · 0 comments
bq14 commented
I'm starting work on a Laravel8 project that has Twig/Bridge installed.
I'm able to use Twig templates in Laravel. They render normally.
I want to add an existing Twig Filter
"markdown_to_html: The markdown_to_html filter converts a block of Markdown to HTML"
https://twig.symfony.com/doc/3.x/filters/markdown_to_html.html
which allows using markdown in Twig templates
{% apply markdown_to_html %}
Title
======
Hello!
{% endapply %}
I've been reading this section over and over
https://github.com/rcrowe/TwigBridge#user-content-extensions
I just can't wrap my head around it yet. :-/
For the simple case of getting Twig's existing 'markdown_to_html' extension to "apply" in this Laravel8+twig/bridge setup, what specific changes do I need to make to the Laravel project config?
Any good start-to-finish example available?