2

我正在尝试在我的管理页面中获取布局。

如果我在我的控制器(Highor_Plugin_StatisticsController)中执行 var_dump,那么我会看到转储。

这是我到目前为止所拥有的:

app/code/local/Highor/Plugin/etc/config.xml

  <?xml version="1.0"?>
<config>
    <modules>
        <highor_plugin>
            <version>1.0.0</version>
            <depends>
                <!-- no dependencies -->
            </depends>
        </highor_plugin>
    </modules>
    <global>
        <models />
        <blocks />
        <resources />
        <extraconfig />
        <helpers>
            <highorplugin>
                <class>Highor_Plugin_Helper</class>
            </highorplugin>
        </helpers>
    </global>
    <admin>
        <routers>
            <highorplugin>
                <use>admin</use>
                <args>
                    <module>Highor_Plugin</module>
                    <frontName>highorplugin</frontName>
                </args>
            </highorplugin>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <highor_plugin>
                    <file>highorplugin.xml</file>
                </highor_plugin>
            </updates>
        </layout>
    </adminhtml>
</config>

app/design/adminhtml/default/default/layout/highorplugin.xml

<?xml version="1.0"?>
<layout>
    <highorplugin_statistics_index>
        <reference name="content">
            <block type="core/template" name="highor" template="highor/plugin.phtml" />
        </reference>
    </highorplugin_statistics_index>
</layout>

app/design/frontend/base/default/template/highor/plugin.phtml

一些文字...

4

1 回答 1

6

您的布局更新是针对adminhtml区域的,因此 Magento 正在 adminhtml 包/主题中搜索相应的模板,但您的模板位于前端区域中,因此找不到任何内容。

你的语法的其余部分看起来都很好,所以只需移动这个文件:

app/design/ frontend/base/default/ template/ highor /plugin.phtml

到这个位置:

app/design/ adminhtml/default/default /template/ highor /plugin.phtml

它应该可以正常工作。

于 2014-07-20T23:38:21.090 回答