Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full example for adding an existing Twig Extension to Laravel8 +TwigBridge? #414

Closed
bq14 opened this issue Jun 16, 2021 · 0 comments
Closed

Comments

@bq14
Copy link

bq14 commented Jun 16, 2021

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?

@bq14 bq14 closed this as completed Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant