Reputation: 4359
I'm trying to create a custom admin module but the phtml file did not load, here is the code
controller.php
<?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";
}
}
adminhtml.xml
<?xml version="1.0"?>
<config>
<menu>
<adminlog module="adminlog" translate="title">
<title>Admin Log</title>
<sort_order>72</sort_order>
<children>
<adminlog module="adminlog" translate="title">
<title>Manage</title>
<sort_order>450</sort_order>
<action>adminlog/adminhtml_adminlog</action>
</adminlog>
</children>
</adminlog>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<adminlog module="adminlog" >
<title>adminlog</title>
<sort_order>200</sort_order>
</adminlog>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<adminlog>
<file>adminlog.xml</file>
</adminlog>
</updates>
</layout>
</config>
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>
Anyone can figure out the problems? thanks
Upvotes: 0
Views: 1135
Reputation: 1720
Where is your config.xml
??
You need to add your layout file in config.xml
inside <adminhtml>
tab.
Like this
<adminhtml>
<layout>
<updates>
<demo>
<file>demo.xml</file>
</demo>
</updates>
</layout>
</adminhtml>
Upvotes: 1