V
V
Viktor Volkov2018-03-16 13:35:45
Yii
Viktor Volkov, 2018-03-16 13:35:45

How in a file is a class called by its unqualified name?

Faced the following example: There is a file, a namespace is set in it and several more spaces are connected. 5aab9d7daa9f5313812516.png further in this file there is a link to the Blog class (an instance of it is created, its namespace is imported) 5aab9b324e8d5544260857.png. now the question is: the link uses an unqualified name (because the name is without a prefix) and according to the article ( https://habrahabr.ru/post/72097/) the program should not find this class, since it will look for matches only in its namespace (in this case in namespace backend\controllers; ). nevertheless everything works...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Volkov, 2018-03-16
@VGVolkov

or by connecting the fully qualified class name we are connecting the class itself?

M
Maxim Timofeev, 2018-03-16
@webinar

declared via use, used it is
not declared - searched in backend\controllers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question