patternengine-php-twig icon indicating copy to clipboard operation
patternengine-php-twig copied to clipboard

Proof-of-concept Twig 2.x integration

Open squidfunk opened this issue 8 years ago • 2 comments

For a client project which has Symfony 3 as a dependency I want to be able to use Patternlab with Twig 2.x, which is the default version bundled with the framework. For this reason I forked the project and created a proof-of-concept working version which might be a good starting point for supporting Twig 2.x. This is the corresponding PR.

I think it would be of great use for many developers, but as there are no tests, I'm not a 100% sure I got everything right. Feel free to comment and see this PR as a work-in-progress.

squidfunk avatar Sep 12 '17 13:09 squidfunk

Thanks @squidfunk!!

Out of curiosity, have you guys tried using Twig embeds with this implementation?

I'm still experimenting a bit with this locally which, for the most part, works perfectly, however I've noticed that something relating to embeds (but not extends or includes) appears to throw a Twig error relating to a string template not being found...

Have you guys encountered any other problems or strange behavior with this upgrade to Twig v2?

CC @EvanLovely @aleksip

sghoweri avatar Nov 04 '17 17:11 sghoweri

To be honest, we switched to patternlab-node and now use twig.js for rendering. The PHP version is so flawed and so slow that we had no choice. twig.js is not a perfect solution, but it works and we can even render twig templates in the browser.

squidfunk avatar Nov 06 '17 08:11 squidfunk