我正在尝试为我的自定义管理页面“设备”加载自定义布局页面。它不工作!:)
<layout version="0.1.0">
<adminhtml_devices_index_index>
<reference name="content">
<block type="adminhtml/template" name="index" output="toHtml" template="devices/index.phtml"/>
</reference>
</adminhtml_devices_index_index>
</layout> 如果这是我的app/design/adminhtml/default/default/layout/devices.xml中的XML
我必须了解哪些不同的文件/属性?
另外,type='adminhtml/template‘到底指向什么?
注意:我的控制器代码是
public function indexAction() {
$this->loadLayout();
$this->renderLayout();
}发布于 2012-06-21 21:25:29
要快速测试,请使用非模板块。该块将在"content“块中作为渲染过程输出,因此不需要指定output="toHtml"。
<reference name="content">
<block type="core/text" name="devices.test">
<action method="setText">
<val>This is some sample text</val>
</action>
</block>
</reference>块类型参数adminhtml指向在Mage_Adminhtml config.xml中定义的块类组“adminhtml/template”:
<global>
<blocks>
<adminhtml>
<class>Mage_Adminhtml_Block基于此,adminhtml/template参数指向块名Mage_Adminhtml_Block_Template。
发布于 2012-06-21 21:10:14
试试看:
<layout version="0.1.0">
<devices_adminhtml_index_index>
<reference name="content">
<block type="adminhtml/template" name="index" output="toHtml" template="devices/index.phtml"/>
</reference>
</devices_adminhtml_index_index>
</layout> 我不确定这里应该是什么:adminhtml/template尝试用core/template替换它
https://stackoverflow.com/questions/11137868
复制相似问题