Using Twig In Yii 2

I see there have been several discussions about the Twig syntax in Yii 2, but nothing has been decided yet. Looking at the PHP templates, Yii 2 relies heavily on static methods, which you can’t call from Twig by default.

Does the Yii team have any thoughts on how to overcome this? Maybe a method() function which calls the static method using reflection/call_user_func_array? Or a global prefix like the Yii 1 Twig renderer has?

It would also be nice if this functionality has the is_safe option set, so the output is not HTML encoded. I don’t think this is possible with globals.

P.S. A "t" function which calls Yii::t would also be great for easy translation in views.

No thoughts about it yet.