小编Raj*_*omy的帖子

自定义模块路由在magento中不起作用

我是magento的初学者.我添加了一个自定义模块,并为该自定义模块进行了路由.但它根本没有显示任何内容,显示空白页面!甚至没有找到页面消息.这是我的代码..

我的配置文件如下app/code/local/Test/Test/etc/config.xml

<config>
<modules>
    <Test_Test>
        <version>0.7.1</version>
    </Test_Test>
</modules>
<frontend>
    <routers>
        <test>
            <use>standard</use>
            <args>
                <module>Test_Test</module>
                <frontName>test</frontName>
            </args>
        </test>
    </routers>
<layout>
    <updates>
        <test>
            <file>test.xml</file>
        </test>
    </updates>
</layout>
</frontend>
Run Code Online (Sandbox Code Playgroud)

我在app/etc/modules/Test_Test.xml中的T​​est_Test.xml文件

<config>
    <modules>
        <Test_Test>
            <active>true</active>
            <codePool>local</codePool>
        </Test_Test>
    </modules>
</config>
Run Code Online (Sandbox Code Playgroud)

我在app/code/local/Test/Test/controllers/IndexAction.php中的IndexController.php文件

<?php
        class Test_Test_IndexController extends Mage_Core_Controller_Front_Action
    {
        public function indexAction()
        {
            $this->getLayout();
            $this->renderLayout();
        }
    }
Run Code Online (Sandbox Code Playgroud)

我在app/design/frontend/default/default/layout/test.xml中的test.xml文件

<layout version="0.7.0">
    <test_index_index>
        <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
            </action>
        </reference>
        <reference name="content">
            <block type="test/view" name="test_index_view" template="test/view.phtml" />
        </reference>
     </test_index_index>
</layout>
Run Code Online (Sandbox Code Playgroud)

我在app/design/frontend/default/default/template/test/view.phtml中的view.phtml文件

<?php 
    echo "test test test test";
?>
Run Code Online (Sandbox Code Playgroud)

我已经调用了以下网址网址1: …

php xml magento

1
推荐指数
1
解决办法
7578
查看次数

标签 统计

magento ×1

php ×1

xml ×1