【问题标题】:Magento page not loadingMagento 页面未加载
【发布时间】:2017-08-25 04:33:33
【问题描述】:

我正在尝试学习本教程:http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-5.html

我使用的是 Magento 1.9.x(不是 2)

我一直在创建一个博客模块,该模块已启用,但路径在我的浏览器中不起作用。

代码/local/Magentotutorial/Weblog/controllers/IndexController.php 中的IndexController.php

<?php
class Magentotutorial_Weblog_IndexController extends 
    Mage_Core_Controller_Front_Action {
        public function testModelAction() {
            echo 'Setup!';
        }
    }

app/etc/modules/Magentotutorial_Weblog.xml 中的 Magentotutorial_Weblog.xml

<config>
<modules>
    <Magentotutorial_Weblog>
        <active>true</active>
        <codePool>local</codePool>
    </Magentotutorial_Weblog>
</modules>

app/code/local/Magentotutorial/Weblog/etc/config.xml 中的config.xml

<frontend>
<routers>
    <weblog>
        <use>standard</use>
        <args>
            <module>Magentotutorial_Weblog</module>
            <frontName>weblog</frontName>
        </args>
    </weblog>
</routers>
</frontend>

我尝试加载页面http://localhost/MagentoTut/weblog/index/testModel,但出现404 Not Found。我错过了创建模块所需的东西吗?它说我的管理面板中启用了该模块,所以可能路由不正确?

非常感谢。

【问题讨论】:

  • 我没有看到你的观点。你的模板在哪里?
  • @NMoeini 我认为 OP 只是试图从控制器显示echo 'Setup!';。所以视图不存在
  • 是的,还没有尝试使用模板。感谢您澄清 B. Desai。

标签: php xml magento config


【解决方案1】:

我找到了问题。这是我的 config.xml 文件,我已将其修改为如下所示:

<config>    
<modules>
    <Magentotutorial_Weblog>
        <version>0.1.0</version>
    </Magentotutorial_Weblog>
</modules>
<frontend>
    <routers>
        <weblog>
            <use>standard</use>
            <args>
                <module>Magentotutorial_Weblog</module>
                <frontName>weblog</frontName>
            </args>
        </weblog>
    </routers>  
</frontend>
</config>

谢谢:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-14
    • 1970-01-01
    • 2018-02-25
    • 2012-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多