1

配置文件

<?xml version="1.0"?>
        <config>
            <modules>
                <Asgard_New>
                    <version>1.6.0.0</version>
                </Asgard_New>
            </modules>
            <global>
                <models>
                    <asgardnew>
                        <class>Asgard_New_Model</class>
                    </asgardnew>
                </models>
                <helpers>
                    <asgardnew>
                        <class>Asgard_New_Helper</class>
                    </asgardnew>
                </helpers>
            </global>
            <frontend>
                <routers>
                    <asgardnew>
                        <use>standard</use>
                        <args>
                            <module>Asgard_New</module>
                            <frontName>new</frontName>
                        </args>
                    </asgardnew>
                </routers>
            </frontend>
    </config>

Asgard_New.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Asgard_New>
            <active>true</active>
            <codePool>local</codePool>
        </Asgard_New>
    </modules>
</config>

索引控制器.php

<?php
class Asgard_New_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        echo "Hello, magento!!";
    }
    public function helloAction()
    {
        echo "Hello, action!!";
    }
    public function layoutAction()
    {
        $xml = $this->loadLayout()->getLayout()->getUpdate()->asString();
        $this->getResponse()->setHeader("Content-Type", "text/plain")->setBody($xml);
        Mage::log($xml, Zend_Log::INFO, 'layout_log', true);
    }
    public function defaultAction()
    {
        $this->loadLayout()->renderLayout();
    }
}
?>

Modul -> local/Asgard 我有相同代码的文件夹 Test ans New

http://magento/test/index/index
http://magento/new/index/index

不工作,前两天工作,但今天我尝试创建一个自己的包和主题,这是停止工作。为什么会发生,伙计们?谢谢!

4

1 回答 1

1

尝试用 new 替换 asgardnew

<frontend>
    <routers>
        <new>
            <use>standard</use>
            <args>
                <module>Asgard_New</module>
                <frontName>new</frontName>
            </args>
        </new>
    </routers>
 </frontend>
于 2013-10-03T18:46:36.373 回答