First of all I'm trying to load grid container and show container heading. My block file is working fine. Container path is Super->Awesome->Block->Adminhtml->Awesome.php which contains
<?php
class Super_Awesome_Block_Adminhtml_Awesome extends Mage_Adminhtml_Block_Widget_Grid_Container
{
public function __construct()
{
$this->_blockGroup = 'super_awesome';
$this->_controller = 'adminhtml_awesome';
$this->_headerText = Mage::helper('super_awesome')->__('Manage');
parent::__construct();
}
}
layout file super_awesome.xml
<?xml version="1.0"?>
<layout>
<adminhtml_example_index>
<reference name="content">
<block type="super_awesome/adminhtml_awesome" name="super_awesome"></block>
</reference>
</adminhtml_example_index>
</layout>
If I echo something inside public function __construct()
, it's showing content but on adding proper __contruct()
method as above it's showing a blank page.
Do I need to add internal block(Grid.php) also, then my container text will appear? Container block Awesome.php should be changed to Grid.php?
Config.xml
<?xml version="1.0"?>
<config>
<modules>
<Super_Awesome>
<version>0.1.0</version>
</Super_Awesome>
</modules>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<super_awesome before="Mage_Adminhtml">Super_Awesome</super_awesome>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<super_awesome>
<file>super_awesome.xml</file>
</super_awesome>
</updates>
</layout>
</adminhtml>
<global>
<blocks>
<super_awesome>
<class>Super_Awesome_Block</class>
</super_awesome>
</blocks>
<helpers>
<super_awesome>
<class>Super_Awesome_Helper</class>
</super_awesome>
</helpers>
</global>
</config>
Super_Awesome_Block_Adminhtml_Awesome_Grid.php
? – Adarsh Khatri Jun 30 '15 at 1:47