在url中输入前端名称时,config.xml前端名称不起作用

时间:2014-11-18 11:20:29

标签: magento

我创建了我的自定义模块,它在后端运行正常(添加,编辑,删除,列表),但是当我在url中输入frontname时,它显示我找不到页面错误。下面是我的代码

<frontend>
    <routers>
        <ydg_cylinderworksheet>
            <use>standard</use>
            <args>
                <module>ydg_Cylinderworksheet</module>
                <frontName>cylinder-worksheet</frontName>
            </args>
        </ydg_cylinderworksheet>
    </routers>
    <layout>
        <updates>
            <ydg_cylinderworksheet>
                <file>ydg_cylinderworksheet.xml</file>
            </ydg_cylinderworksheet>
        </updates>
    </layout>
    <translate>
        <modules>
            <ydg_Cylinderworksheet>
                <files>
                    <default>ydg_Cylinderworksheet.csv</default>
                </files>
            </ydg_Cylinderworksheet>
        </modules>
    </translate>
</frontend>

2 个答案:

答案 0 :(得分:2)

您需要在etc / config.xml中更改路由器的标签

<routers>
            <cylinderworksheet>
                <use>standard</use>
                <args>
                    <module>Ydg_Cylinderworksheet</module>
                    <frontName>cylinder-worksheet</frontName>
                </args>
            </cylinderworksheet>

 </routers>

...

答案 1 :(得分:0)

您需要更改代码

 <frontend>
    <routers>
    <cylinderworksheet>
        <use>standard</use>
        <args>
            <module>ydg_Cylinderworksheet</module>
            <frontName>cylinderworksheet</frontName>
        </args>
    </cylinderworksheet>
    </routers>
    .........