如果这是一个新手问题,我是Magento的新手。我有一个模块Foo_Bar。在controllers文件夹中,我有另一个名为'Catalog'的文件夹。在那里,我有我的CategoryController.php。
这是我的CategoryController.php
:
class Foo_Bar_Catalog_CategoryController extends Mage_Core_Controller_Front_Action
{
public function viewAction()
{
echo 'It worked!';
}
}
我的config.xml如下:
<config>
<frontend>
<routers>
<foo_bar>
<use>standard</use>
<args>
<module>Foo_Bar</module>
<frontName>foo</frontName>
</args>
</foo_bar>
</routers>
</frontend>
</config>
我的模块已启用,并且它显示在Configuration Manager中。
问题是,当我转到http://magento.localhost.com/magento/foo/catalog/category/view时,我收到'抱歉页面无法找到'。当我将控制器放在'controllers'文件夹(不在目录下)并重命名控制器的类名时,http://magento.localhost.com/magento/foo/category/view有效。
问题似乎与在controllers文件夹中有一个文件夹有关。这种方法有什么问题?
非常感谢!
Krt_Malta