Closed nepster-web closed 3 years ago
However if you use globals
for Profile class, everything works correctly.
So basically exactly what it says in the docs? ;)
@bizley, in the sense ?
I meant that the global
works, but the use
does not work.
the bug is relevant !!!
In most cases, except widgets and assets, you have to import classes via globals.
got it. thanks.
Doc: https://github.com/yiisoft/yii2-twig/blob/master/docs/guide/template-syntax.md#importing-other-classes
I have model with static method:
In twig:
{{ use('/common/modules/users/models/Profile') }} {{ dump(Profile.getUserTypeArray()) }}
And result:
null