Why doesn't magento autoload parent class

半城伤御伤魂 提交于 2019-12-05 16:25:23

The Magento autoloader is a simple "replace underscores with slashes" algorithm. Because Zend Framework names its controllers differently, and because Magento uses parts of Zend and is inspired by Zend in others, its controllers are named with Zend conventions and placed in a controllers folder, meaning the standard autoload routine won't work.

It ends up controller classes are automatically included during Magento's routing process but NOT by the PHP auto loader. Instead, there's custom PHP code to handle this.

So, during routing, because you've told Magento to use your controllers instead of Magento's controller for a particular request, it's the only controller that gets included.

Best guess is the request for controller overrides caught the original developers off guard, and while they've been happy to jury rig a solution with routing, it hasn't been a priority to refactor the controller autoload code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!