1

this is my config file

<?xml version="1.0"?>
<config>
    <modules>
        <Ilogix_Regionbased>
            <version>0.1.0</version>
        </Ilogix_Regionbased>
    </modules>
    <frontend>
        <routers>
            <regionbased>
                <use>standard</use>
                <args>
                    <module>Ilogix_Regionbased</module>
                    <frontName>ilogix_regionbased</frontName>
                </args>
            </regionbased>
        </routers>
    </frontend>
    <admin>
        <routers>
            <regionbased>
                <use>admin</use>
                <args>
                    <module>Ilogix_Regionbased</module>
                    <frontName>ilogix_regionbased</frontName>
                </args>
            </regionbased>
        </routers>
    </admin>
    <global>
        <helpers>
            <regionbased>
                <class>Ilogix_Regionbased_Helper</class>
            </regionbased>
        </helpers>
        <blocks>
            <ilogix_regionbased>
                <!-- Set a block definition and lookup directory -->
                <class>Ilogix_Regionbased_Block_Adminhtml_Regionbased</class>
            </ilogix_regionbased>
        </blocks>
    </global>
    <adminhtml>
        <layout>
            <updates>
                <regionbased>
                    <file>ilogix/regionbased.xml</file>
                </regionbased>
            </updates>
        </layout>
        <menu>
            <catalog module="adminhtml">
                <children>
                    <regionbased module="regionbased">
                        <title>Regions</title>
                        <sort_order>181</sort_order>
                        <action>ilogix_regionbased/adminhtml_index</action>
                    </regionbased>
                </children>
        </catalog>
        </menu>
    </adminhtml>
</config>

this is my block file /app/code/local/Ilogix/Regionbased/Block/Adminhtml/Regionbased.php

class Ilogix_Regionbased_Block_Adminhtml_Regionbased extends Mage_Core_Block_Template
{
    public function __construct()
    {
        parent::__construct();
    }
}

this is my layout xml file

<?xml version="1.0" ?>
<layout>
        <regionbased_adminhtml_index_index>
        <reference name="content">
            <block type="core/template"  name="regions" template="regionbased/index.phtml"/>
        </reference>
    </regionbased_adminhtml_index_index>
</layout>

Here when I use block type="core/template" it perfectly renders my phtml file but when I try to use block type="regionbased/adminhtml_regionbased" it does not render the phtml file . not sure what am I doing wrong here . Please help!

Thanks

  • Pls try : type ="ilogix_regionbased/adminhtml_regionbased" – Abdul Dec 7 '18 at 12:17
0

Try this:

layout xml file:

<?xml version="1.0" ?>
<layout>
    <regionbased_adminhtml_index_index>
        <reference name="content">
            <block type="regionbased/adminhtml_regionbased"  name="regions" template="regionbased/index.phtml"/>
        </reference>
    </regionbased_adminhtml_index_index>
</layout>

block file:

<?php

class Ilogix_Regionbased_Block_Adminhtml_Regionbased extends Mage_Adminhtml_Block_Template
{
    public function __construct()
    {
        parent::__construct();
    }

}

config.xml file

 <global>
        <blocks>
            <regionbased>
                <class>Ilogix_Regionbased_Block</class>
            </regionbased>
        </blocks>
 </global>
  • thanks @Abdul , I was doing it in a wrong way I changed <blocks> <ilogix_regionbased> <!-- Set a block definition and lookup directory --> <class>Ilogix_Regionbased_Block</class> </ilogix_regionbased> </blocks> I am trying your answer as well . – Rahul Makwana Dec 7 '18 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.