Magento 示例后管理模块不工作

Magento 示例后管理模块不工作,magento,Magento,按照以下步骤,我仍然看不到它起作用: 这是否仍然适用于最新版本的Magento,或者该教程是否过时 还有什么其他原因会导致404错误出现吗 配置文件: <config> <modules> <Alanstormdotcom_Adminhelloworld> <version>0.1.0</version> </Alanstormdotcom_Adminhelloworld> </mod

按照以下步骤,我仍然看不到它起作用:

这是否仍然适用于最新版本的Magento,或者该教程是否过时

还有什么其他原因会导致404错误出现吗

配置文件:

<config>
<modules>
    <Alanstormdotcom_Adminhelloworld>
        <version>0.1.0</version>
    </Alanstormdotcom_Adminhelloworld>
</modules>
<admin>
    <routers>
        <the_name_of_this_element_is_not_important_it_should_be_unique>
            <use>admin</use>
            <args>
                <module>Alanstormdotcom_Adminhelloworld</module>
                <frontName>adminhelloworld</frontName>
            </args>
        </the_name_of_this_element_is_not_important_it_should_be_unique>
    </routers>
</admin>
<adminhtml>
    <menu>
        <tutorial_menu translate="title" module="adminhelloworld">
            <title>Tutorial Menu</title> 
            <sort_order>9999</sort_order>
            <children>
                <first_page module="adminhelloworld">
                    <title>Our First Page</title> 
                    <action>adminhelloworld/index/index</action>
                </first_page>
            </children>
        </tutorial_menu>
        <system>
            <children>
                <another_menu_from_us>
                    <title>Here Too!</title> 
                    <action>adminhelloworld/index/index</action>
                </another_menu_from_us>
            </children>
        </system>
    </menu> 
</adminhtml>
<global>
    <helpers>
        <adminhelloworld>
            <class>Alanstormdotcom_Adminhelloworld_Helper</class>
        </adminhelloworld>
    </helpers>
</global>  

0.1.0
管理
Alanstormdotcom_Adminhelloworld
adminhelloworld
教程菜单
9999
我们的第一页
adminhelloworld/index/index
这里也是!
adminhelloworld/index/index
Alanstormdotcom\u Adminhelloworld\u助手

索引控制器:

类Alanstormdotcom\u Adminhelloworld\u IndexController扩展了Mage\u Adminhtml\u控制器\u操作 { 公共函数索引() { $this->loadLayout()

//创建一个名为“示例块”的文本块
$block=$this->getLayout()
->createBlock('核心/文本','示例块')
->setText(“这是一个文本块”);
$this->\u addContent($block);
$this->renderLayout();
} 受保护函数\u addContent(Mage\u Core\u Block\u Abstract$Block) { $this->getLayout()->getBlock('content')->append($block); 退还$this; }
}

我终于让它工作了

代码示例中缺少了一些打开的php标记,但最重要的部分是清除所有正确的缓存,然后开始显示正确的内容

永远记住缓存部分


希望这对其他人有所帮助

我投票结束这个问题,因为它是关于Magento管理的,属于模块开发,与管理无关
    //create a text block with the name of "example-block"
    $block = $this->getLayout()
    ->createBlock('core/text', 'example-block')
    ->setText('<h1>This is a text block</h1>');

    $this->_addContent($block);

    $this->renderLayout();