Want to learn Twig templating with Yii2


I am looking for learning resources for using Twig templating system with Yii2.

The problem is of course not about the Twig itself but about using all the variety of Yii2 widgets with Twig. I would love to learn it from more exerienced users. Can anybody share some demo? Simple Layout/View files rendered with Twig but using common Bootstrap elements, flexible design and some popular Yii2/Kartik widgets (e.g. gridView, detailView).

Any idea?

I have long experience with TWIG in SYMPHONY2, and unless you really plan to put to work designers or similar profiles (non full developers) to implement the TWIGS TEMPLATES, I do not recommend you to go for it. It is quite uncomfortable to use the non php language approach, you won’t be able to debug the views and with all page aching of Yii2 I do not really see any benefit for using TWIG. Specially if you intend to use Grid-Views and CRUD via Gii tool, I do not recommend it.

Joaquim - thank you very much for this constructive answer!

It is perhaps a bit unexpected but - looks like indeed founded on experience, so I will follow.

On the other hand - can you please explain why Twig templating is so frequently used within Symfony environment while you explained why it is not worth much within Yii environment. Are both frameworks so much difeerent in terms of views generation that there is such a huge outcome on templating system usage?

Thanks ahead!