【发布时间】:2016-01-04 14:49:15
【问题描述】:
我正在尝试遵循 http://alanstorm.com/magento_admin_hello_world_revisited 教程并在 magento 1.9.x 中设置自定义管理模块。
可下载的样板 http://alanstorm.com/2013/projects/Pulsestorm_Adminhello.tar 工作正常。当它上传到 magento 时,我可以看到以下内容:
当您单击示例菜单项时,您会看到一个空白页面。
所以,我现在想将我自己的.phtml 加载到视图中。因此,在模块的config.xml 上,我添加了以下内容:
app/code/community/Pulsestorm/Adminhello/etc/config.xml
<?xml version="1.0"?>
<config>
...
<adminhtml>
<layout>
<updates>
<adminhello>
<file>adminhello.xml</file>
</adminhello>
</updates>
</layout>
</adminhtml>
</config>
然后我创建了以下布局 xml 文件:
app/design/adminhtml/default/default/layout/adminhello.xml
<?xml version="1.0"?>
<layout version="1.0">
<adminhtml_adminhello_index>
<block type="core/template" output="toHtml" name="templateBlock" template="adminhello/index.phtml">
</adminhtml_adminhello_index>
</layout>
然后我创建了以下模板 phtml 文件:
app/design/adminhtml/default/default/template/adminhello/index.phtml
<b>Hello World</b>
当我刷新页面时(Pulse Storm -> Example),我仍然看到一个空白页面。我在这里错过了什么?
【问题讨论】: