I read that using fallback — autoload mode — is very bad. I read a lot about autoloading, but got confused. How do I connect my class automatically? The Articles class is declared in the file application/models/Articles.php . The application/controllers/ArticlesController.php file uses the Articles class (without manually connecting the file). After I removed the fallback mode, he, of course, stopped finding this class. How can I get it to autostart?

PS: in bootstrap.php , if anything, there is such a line:

 $autoloader = Zend_Loader_Autoloader::getInstance(); 
  • Who can tell?) - Oleg Arkhipov
  • Ah, I sort of understood. I need to register my prefix: $ autoloader-> registerNamespace ('lol'); At the same time, I add this prefix (in the example - lol) to the names of both the classes and their files, for example, instead of the Articles.php file with the Articles class make lolArticles.php with the lolArticles class. Now it works (before that, when it didn't work out, I did it like, but I didn’t add the prefix to the file and class names at the same time). This is how it works. It is right? - Oleg Arkhipov

0