0

This is the content of my custom module, config.xml file:

<adminhtml>
 <layout>
 <updates>
 <mymodule>
 <file>homepage.xml</file>
 </mymodule>
 </updates>
 </layout>
 </adminhtml>

this is the content of the layout/homepage.xml file from

<?xml version="1.0"?>
<layout>
 <adminhtml_manage_index>
 <reference name="content">
 <block type="mynamespace_mymodule/adminhtml_banner" name="mynamespace_mymodule_banner" />
 </reference>
 </adminhtml_manage_index>
</layout>

This is the content of my controller Mynamespace/Mymodule/controllers/Adminhtml/ManageController.php

class Mynamespace_Mymodule_Adminhtml_ManageController extends Mage_Adminhtml_Controller_Action
{
 public function indexAction()
 { 
 $this->loadLayout();
 $this->_initAction()->renderLayout();
 } 
}

and the content of the Mynamespace/Mymodule/Block/Adminhtml/Banner.php

class Mynamespace_Mymodule_Block_Adminhtml_Banner extends Mage_Adminhtml_Block_Widget_Grid_Container
{
 public function __construct()
 {
 echo 1; exit();
//....
 }
}

My problem is that it doesn't access the block. I put an exit() there . But I cannot get there. Why ? What am I missing ? thx

asked Nov 4, 2015 at 12:14
5
  • Please replace Mynamespace/Mymodule/Block/AdminHtml/Banner.php to and the content of the Mynamespace/Mymodule/Block/Adminhtml/Banner.php Commented Nov 4, 2015 at 12:25
  • Mynamespace/Mymodule/controllers/AdminHtml/ManageController.php to Mynamespace/Mymodule/controllers/Adminhtml/ManageController.php Commented Nov 4, 2015 at 12:25
  • @Abdul I don't understand. Can you give more details! Commented Nov 4, 2015 at 12:31
  • rename folder name "AdminHtml" => "Adminhtml" Commented Nov 4, 2015 at 12:34
  • sorry my mistake, it is Adminhtml not AdminHTML, from the start, I updated my post Commented Nov 4, 2015 at 12:37

1 Answer 1

1

Rename folder name "AdminHtml" => "Adminhtml"

Please replace from

<?xml version="1.0"?>
<layout>
 <adminhtml_manage_index>
 <reference name="content">
 <block type="mynamespace_mymodule/adminhtml_banner" name="mynamespace_mymodule_banner" />
 </reference>
 </adminhtml_manage_index>
</layout>

To

<?xml version="1.0"?>
<layout>
 <mymodule_adminhtml_manage_index>
 <reference name="content">
 <block type="mynamespace_mymodule/adminhtml_banner" name="mynamespace_mymodule_banner" />
 </reference>
 </mymodule_adminhtml_manage_index>
</layout>
answered Nov 4, 2015 at 12:33
3
  • nothing changed I still don't get to echo 1; exit(); . any other idea ? thx Commented Nov 4, 2015 at 12:35
  • can you please vote me and assp my ans? Commented Nov 4, 2015 at 12:39
  • its work. but instead of mymodule, i must write mynamespace. please update your post with my suggestion and I will accept your post as answer. thx Commented Nov 4, 2015 at 12:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.