Answer the question
In order to leave comments, you need to log in
How to create a similar structure Class1::$app->class2->method()?
In Yii, you can call other classes and their methods through the main class. For example, Yii::$app->security->getRandomString(). And how is it possible to create such a structure? Or is there a common name for something like this?
Answer the question
In order to leave comments, you need to log in
Yii::$app is a static class property. In fact, something like a singleton. Total - anti-pattern.
https://github.com/yiisoft/yii2/blob/2.0.29/framew...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question