Answer the question
In order to leave comments, you need to log in
Hello! explain, pzhl, about the namespace classes?
When studying the corresponding article on Habré ( https://habrahabr.ru/post/72150/) , I got the impression that the "computer" (well, yes, I'm a teapot) finds a class to which there is a link (well, let's say when creating another class or when creating instance) by the namespace itself (we flip the slashes, and in the project directory we have already formed the corresponding folders where, in fact, the classes are located, each in a separate file). Just tell me, did I understand correctly?) This is my first question on the Toaster, thanks in advance)
Answer the question
In order to leave comments, you need to log in
in this particular implementation - yes
The string "App\Lib1\MyClass" is passed to the __autoload function. This replaces all namespace backslashes with file path forward slashes, and modifies the string so that the file "classes\App\Lib1\MyClass.php" is loaded.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question