magento自定义管理模块可以';t加载phtml布局文件
我正在尝试创建一个自定义管理模块,但是没有加载phtml文件,下面是代码 controller.phpmagento自定义管理模块可以';t加载phtml布局文件,magento,Magento,我正在尝试创建一个自定义管理模块,但是没有加载phtml文件,下面是代码 controller.php <?php class TempName_AdminLog_Adminhtml_AdminLogController extends Mage_Adminhtml_Controller_Action { public function indexAction() { //$this->loadLayout()->_setActive
<?php
class TempName_AdminLog_Adminhtml_AdminLogController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
//$this->loadLayout()->_setActiveMenu('AdminLog/items');
$this->loadLayout();
$this->renderLayout();
var_dump(Mage::getSingleton('core/layout')->getUpdate()->getHandles());
die();
//echo "abc";
}
}
管理日志
72
管理
450
adminlog/adminhtml\u adminlog
允许一切
管理员日志
200
adminlog.xml
adminlog.xml
<?xml version="1.0"?>
<layout>
<adminlog_adminhtml_adminlog_index>
<update handle="adminlog_adminlog_index"/>
<reference name="content">
<block type="adminhtml/template" name="adminlog" template="adminlog/adminlog.phtml"/>
</reference>
</adminlog_adminhtml_adminlog_index>
</layout>
config.xml
<?xml version="1.0"?>
<config>
<modules>
<TempName_AdminLog>
<version>1.0.0</version>
<title>Admin log module</title>
</TempName_AdminLog>
</modules>
<global>
<helpers>
<adminlog>
<class>TempName_AdminLog_Helper</class>
</adminlog>
</helpers>
<default>
<adminlog>
<general>
<enable>1</enable>
</general>
</adminlog>
</default>
</global>
<admin>
<routers>
<adminlog>
<use>admin</use>
<args>
<module>TempName_AdminLog</module>
<frontName>adminlog</frontName>
</args>
</adminlog>
</routers>
</admin>
<layout>
<updates>
<adminlog>
<file>adminlog.xml</file>
</adminlog>
</updates>
</layout>
</config>
1.0.0
管理日志模块
TempName\u AdminLog\u助手
1.
管理
临时名称\u管理日志
管理员日志
adminlog.xml
谁能找出问题所在?谢谢你的
config.xml文件在哪里
您需要在
选项卡内的config.xml
中添加布局文件
像这样
<adminhtml>
<layout>
<updates>
<demo>
<file>demo.xml</file>
</demo>
</updates>
</layout>
</adminhtml>
demo.xml
我在adminhtml.xml.show me your config.xml.中添加了此项。您需要在配置文件而不是adminhtmla中添加此项。在我在config.xml中添加标记后,它会立即加载pthml文件,谢谢!
<adminhtml>
<layout>
<updates>
<demo>
<file>demo.xml</file>
</demo>
</updates>
</layout>
</adminhtml>