Write hello world doesn't render in view in Magento


Write hello world doesn't render in view in Magento

我刚开始学magento。我刚刚做了Hello World的自定义模块。我的命名空间是Company,模块名称是Web。
我的模块Fle - Company_Web.xml

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

这是我的控制器- IndexController。

<?php
class Company_Web_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {    
        $this->loadLayout();     
        $this->renderLayout();
    }
}
?>

My config.xml

<?xml version="1.0" ?>
<config>
    <modules>
        <Company_Web>
            <version>1.6.0.0.2</version>
        </Company_Web>
    </modules>
    <frontend>
        <routers>
            <web>
                <use>standard</use>
                <args>
                    <module>Company_Web</module>
                    <frontName>web</frontName>
                </args>
            </web>
        </routers>
        <layout>
            <updates>
                <web>
                    <file>web.xml</file>
                </web>
            </updates>
        </layout>
    </frontend>
</config>

这是我的布局文件。web . xml

<?xml version="1.0" ?>
<layout version="0.1.0">
    <web_index_index>
        <reference name="content">
            <block type="core/template" name="web" template="web/web.phtml"></block>
        </reference>
    </web_index_index>
</layout>

这是我的视图文件

<p>Hello World!</p>

谁能告诉我我错过了什么?为什么它不在视图文件中呈现。我还禁用了所有缓存。

这是模块的目录结构-

'app'etc'modules'Company_Web.xml
'app'code'local'Company'Web'etc'config.xml
'app'code'local'Company'Web'controllers'IndexController.php
'app'design'frontend'base'default'layout'web.xml
'app'design'frontend'base'default'template'web'web.phtml

请检查您的路径是否有效

你的模块在我的电脑上运行得很好。请检查你放对了地方的所有文件。还要检查文件夹名称。

请刷新缓存,如果启用了编译,则System >> Tools >> Compilation请再次启用run compilation

尝试冲洗现金并检查文件是否在正确的文件夹(包和模板)