控制器文件已加载,但类不存在 [英] Controller file was loaded but class does not exist
问题描述
我无法在Magento中解决此错误:
I am having trouble getting around this error in Magento:
已加载控制器文件,但类不存在". (底部全栈)
"Controller file was loaded but class does not exist". (Full stack at bottom)
我实质上是在尝试遵循本教程:.
I am essentially trying to follow this tutorial: Create new module "HelloWorld" – in Magento.
...尽管我使用自己的公司/类别名称等,而不是"hello world"
...though I am using my own company/class names etc. instead of "hello world"
我通常很难在Magento上找到好的文档,而我对此很陌生...
I am having trouble finding good documentation on Magento in general, and I am very new at it...
有人可以提供一些常见的原因,建议或见解吗?我被淹没了,用谷歌搜索了几个小时,检查权限和文件结构.随便你
can anyone provide some common causes, advice, or insight? I am swamped, googled this for hours, check permissions and file structure. You name it.
Trace:
#0 /var/www/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(306): Mage::exception('Mage_Core', 'Controller file...')
#1 /var/www/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(282): Mage_Core_Controller_Varien_Router_Standard->_inludeControllerClass('/var/www/dev_ml...', 'Foo_Wr...')
#2 /var/www/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(195): Mage_Core_Controller_Varien_Router_Standard->_validateControllerClassName('foo_Wr...', 'index')
#3 /var/www/dev/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /var/www/dev/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#5 /var/www/dev/index.php(65): Mage::run()
#6 {main}
推荐答案
该错误意味着magento在您的控制器上找到了预期会出现(app/code/local/Namespace/Module/controllers/FooController.php)
的文件,但是里面的类没有预期的名称(它不是 Namespace_Module_FooController ).
That error means that magento found a file for your controller where it expected to (app/code/local/Namespace/Module/controllers/FooController.php)
but that the class inside didn't have the name it expected (it wasn't Namespace_Module_FooController).
这篇关于控制器文件已加载,但类不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!