use*_*520 2 layout templates controller magento adminhtml
我正在尝试在管理页面中获取布局.
如果我在我的控制器(Highor_Plugin_StatisticsController)中执行var_dump,那么我会看到转储.
这是我到目前为止:
应用程序/代码/本地/ Highor /插件的/ 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>
Run Code Online (Sandbox Code Playgroud)
应用程序/设计/ adminhtml /默认/缺省/布局/ 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>
Run Code Online (Sandbox Code Playgroud)
应用程序/设计/前端/基/默认/模板/ highor/plugin.phtml
一些文字......
您的布局更新是针对adminhtml区域的,因此Magento正在搜索adminhtml包/主题中的相应模板,但您的模板位于前端区域,因此它找不到任何内容.
你的语法的其余部分看起来都很好,所以只需移动这个文件:
app/design/frontend/base/default /template/highor/plugin.phtml
到这个位置:
app/design/adminhtml/default/default /template/highor/plugin.phtml
它应该工作正常.
归档时间: |
|
查看次数: |
9118 次 |
最近记录: |