I don't know why my block does not get loaded. I already cleared the cache (incl var/cache). Can someone help me figure out what I missed? However, the Here: shows up!
here is my layout xml: app/design/adminhtml/default/default/template/gpa/items.phtml
<?xml version="1.0"?>
<layout>
<gpa_adminhtml_gpa_index>
<reference name="content">
<block type="core/template" name="gpa" template="gpa/items.phtml" />
</reference>
</gpa_adminhtml_gpa_index>
</layout>
items.phtml content:
Here: <?php echo $this->getItems() ?>
block definition:
class Mymodulenamespace_Gpa_Block_Adminhtml_Gpa extends Mage_Core_Block_Template {
public function getItems() {
echo 'ABCDEF';
}
}
here is my controller:
class Mymodulenamespace_Gpa_Adminhtml_GpaController extends Mage_Adminhtml_Controller_Action
{
public function indexAction() {
$this->loadLayout();
$this->renderLayout();
}
}
I can see the output "Here:" so I know my Controller is being loaded correctly and the layout xml is also correct. But why isn't my Block getting instantiated?
Can you please change Mage_Core_Block_Template with Mage_Adminhtml_Block_Template and instead of defining XML layout, try this: