And so, there is a class:
`namespace Controllers; class IndexController { ... }` How in other class to use methods of this class?
namespace Library\MainFunction; class MainFunction { public function foo() { $class = 'Controllers\\IndexController'; $obj = new $class; \\ ошибка Class 'Controllers\IndexController' not found } } What am I doing wrong and how is it right? The call is through a string variable, because the controller will change.
IndexControllerclass to the file with theMainFunctionclass? - ArchDemon\\Controllers\\IndexControllerthen you can try this. For in your example the class is searched from the current namespace - ArchDemonClass '\Controllers\IndexController' not found- Dmitriy