自定义创建的 Magento 控制器 link 到 404
Custom created Magento controller link to 404
在充满谷歌搜索和尝试的不眠之夜之后,我需要你的帮助。
我为 Magento 1.9 创建的控制器在以下地址无法访问:
http://magento1.at/customblog/test/test
domain/frontname/controllername/actionname
我已经在 windows 和 mac 上尝试了 运行,修复了每个文件和文件夹的权限,管理面板注销-登录,清除缓存,重新索引数据,检查我的代码,但仍然没有运气。模块 btw 正在运行,我可以在管理员中 Enable/Disable 它,并且安装脚本没有问题。
所以。请告诉我我的问题在哪里,非常感谢大家!
这是我的代码:
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');
}
}
尝试查看 module.xml
中路由器部分中的两个拼写错误
您在 <use>
标签内写了 standart 而不是 standard
<use>standard</use>
还要注意 upper/lower 大小写字母:在 module.xml
中你到处写 Customblog
,而 class 名称是 CustomBlog
:你必须他们统一并改变两者之一。
在充满谷歌搜索和尝试的不眠之夜之后,我需要你的帮助。 我为 Magento 1.9 创建的控制器在以下地址无法访问: http://magento1.at/customblog/test/test
domain/frontname/controllername/actionname
我已经在 windows 和 mac 上尝试了 运行,修复了每个文件和文件夹的权限,管理面板注销-登录,清除缓存,重新索引数据,检查我的代码,但仍然没有运气。模块 btw 正在运行,我可以在管理员中 Enable/Disable 它,并且安装脚本没有问题。 所以。请告诉我我的问题在哪里,非常感谢大家! 这是我的代码:
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');
}
}
尝试查看 module.xml
您在 <use>
标签内写了 standart 而不是 standard
<use>standard</use>
还要注意 upper/lower 大小写字母:在 module.xml
中你到处写 Customblog
,而 class 名称是 CustomBlog
:你必须他们统一并改变两者之一。