自定义创建的Magento控制器链接到404

问题描述 投票:0回答:1

在没有睡觉的夜晚充满谷歌搜索和尝试的事情,我需要你的帮助。我为Magento 1.9创建的控制器无法访问地址:http://magento1.at/customblog/test/test

domain/frontname/controllername/actionname

我已经尝试在Windows和Mac上运行它,修复了每个文件和文件夹的权限,管理面板注销登录,清除缓存,重新索引数据,检查我的代码,但仍然没有运气。 btw模块正常工作,我可以在admin中启用/禁用它,安装脚本没有问题。所以。拜托,告诉我我的问题在哪里,谢谢,大家这么多!这是我的代码:

config.xml中

<?xml version="1.0"?>
<config>
    <modules>
        <Atwix_CustomBlog>
            <version>1.0.0</version>
        </Atwix_CustomBlog>
    </modules>
    <global>
        <helpers>
            <Atwix_CustomBlog>
                <class>Atwix_Customblog_Helper</class>
            </Atwix_CustomBlog>
        </helpers>
        <models>
            <customblog>
                <class>Atwix_Customblog_Model</class>
                <resourceModel>customblog_resource</resourceModel>
            </customblog>
            <customblog_resource>
                <class>Atwix_Customblog_Model_Resource</class>
                <entities>
                    <block>
                        <table>atwix_article</table>
                    </block>
                </entities>
            </customblog_resource>
        </models>
        <resources>
            <atwix_customblog_setup>
                <setup>
                    <module>Atwix_Customblog</module>
                </setup>
            </atwix_customblog_setup>
        </resources>
    </global>
    <frontend>
        <routers>
            <customblog>
                <use>standard</use>
                <args>
                    <module>Atwix_Customblog</module>
                    <frontName>customblog</frontName>
                </args>
            </customblog>
        </routers>
    </frontend>
</config>

TestController.php

<?php
class Atwix_CustomBlog_TestController extends Mage_Core_Controller_Front_Action {

    public function TestAction()
    {
        echo('test');
    }
}
php magento controller router
1个回答
0
投票

尝试查看module.xml中路由器部分中的两个拼写错误

你在<use>标签里面写了标准而不是标准

<use>standard</use>

还要注意大写/小写字母:在module.xml中你到处都写Customblog,而类名是CustomBlog:你必须让它们变得均匀并改变其中的一个。

© www.soinside.com 2019 - 2024. All rights reserved.