Magento自有模块控制器通向404
我正在尝试创建自己的Magento模块。它应该打印出一个简单的Hello World。 我尝试使用以下URL调用我的模块: //127.0.0.1/magento/echo/echo/index //127.0.0.1/magento/index.php/echo/echo //127.0.0.1/magento/index.php/echo/echo/index 每个URL都指向404页面 我创建了以下文件: app/etc/modules/Webshop_Echo.xmlMagento自有模块控制器通向404,magento,magento-1.9,Magento,Magento 1.9,我正在尝试创建自己的Magento模块。它应该打印出一个简单的Hello World。 我尝试使用以下URL调用我的模块: //127.0.0.1/magento/echo/echo/index //127.0.0.1/magento/index.php/echo/echo //127.0.0.1/magento/index.php/echo/echo/index 每个URL都指向404页面 我创建了以下文件: app/etc/modules/Webshop_Echo.xml <confi
<config>
<modules>
<Webshop_Echo>
<active>true</active>
<codePool>local</codePool>
</Webshop_Echo>
</modules>
</config>
app/code/local/Webshop/Echo/etc/config.xml
<config>
<modules>
<Webshop_Echo>
<version>0.1.0</version>
</Webshop_Echo>
</modules>
<frontend>
<routers>
<echo>
<use>standard</use>
<args>
<module>Webshop_Echo</module>
<frontName>echo</frontName>
</args>
</echo>
</routers>
</frontend>
</config>
app/code/local/Webshop/controller/EchoController.php
<?php
class Webshop_Echo_EchoController extends Mage_Core_Controller_Front_Action {
public function indexAction() {
echo 'Hello World!';
}
}
更改以下控制器位置
app/code/local/Webshop/controller/EchoController.php
到
注意目录名:controllers检查答案并接受是否适合您。
app/code/local/Webshop/controllers/EchoController.php