1

如果这是一个新手问题,我是 Magento 的新手。我有一个模块 Foo_Bar。在控制器文件夹中,我有另一个名为“目录”的文件夹。在里面,我有我的 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>

我的模块肯定已启用,并且显示在配置管理器中。

问题是当我去http://magento.localhost.com/magento/foo/catalog/category/view时,我得到'抱歉页面找不到'。当我将控制器放在“控制器”文件夹中(不在目录下)并重命名控制器的类名时, http: //magento.localhost.com/magento/foo/category/view有效。

该问题似乎与控制器文件夹中有一个文件夹有关。这种方法有什么问题?

非常感谢!

Krt_马耳他

4

1 回答 1

2

你试过这个网址吗:http: //magento.localhost.com/magento/foo/catalog_category/view/

于 2012-04-08T10:56:29.843 回答