Magento模块控制器无法正常工作

Waq*_*uar 1 magento magento-1.7

Tyring创建一个模块,我可以使用catalog-> products模型动态创建产品,并将控制重定向到产品的评论页面.只需单个控制器即可完成单一操作.没有块,助手,模板....没有必要.

但似乎控制器操作没有正确路由,代码或配置中存在一些错误......找不到404错误

试试这个网址:

http://localhost/magento_test/dynamicproduct/index/index
Run Code Online (Sandbox Code Playgroud)

命名空间:Waqasalieee

模块名称:Dynamicproduct

Magento版本: 1.7.0.2

这是文件内容:

本地/ Waqasalieee/Dynamicproduct /控制器/ IndexController.php

<?php
    class Waqasalieee_Dynamicproduct_IndexController extends Mage_Core_Controller_Front_Action
    {
        public function indexAction() {
            die('working in index');
        }
    }
?>
Run Code Online (Sandbox Code Playgroud)

本地/ Waqasalieee/Dynamicproduct的/ etc/config.xml中

<?xml version="1.0"?>
<config>
    <modules>
        <Waqasalieee_Dynamicproduct>
            <version>1.0</version>
        </Waqasalieee_Dynamicproduct>
    </modules>
    <frontend>
        <routers>
            <dynamicproduct>
                <use>standard</use>
                <args>
                    <module>Waqasalieee_Dynamicproduct</module>
                    <frontName>dynamicproduct</frontName>
                </args>
            </dynamicproduct>
        </routers>
    </frontend>

</config>
Run Code Online (Sandbox Code Playgroud)

应用程序的/ etc /模块/ Waqasalieee_Dynamicproduct.xml

<?xml version='1.0'?>
<config>
    <modules>
        <Waqasalieee_Dynamicproduct>
            <codepool>local</codepool>
            <active>true</active>
        </Waqasalieee_Dynamicproduct>
    </modules>
</config>
Run Code Online (Sandbox Code Playgroud)

它应该显示一些错误或'在索引中工作'(字符串)但它给出404找不到错误.

cmo*_*qpr 5

我有同样的sympton并降落在这里.对我来说,错误不是错误的XML配置,而是存储代码实际上被添加到URL(这是一个magento功能,而不是一个bug),所以我的控制器只能通过向URL添加有效的商店代码来访问http://mystore/<storecode>/<controller>/<action>.就我而言http://mage.localhost/en/customer/check