2

My config code

<config>
    <modules>
        <Urban_Module>
            <version>1.0.0</version>
        </Urban_Module>
    </modules>
<global>
        <helpers>
            <Module>
                <class>Urban_Module_Helper</class>
            </Module>  
        </helpers>
</global>
<frontend>
        <routers>
            <module>
                <use>standard</use>
                <args>
                    <module>Urban_Module</module>
                    <frontName>module</frontName>
                </args>
            </module>
        </routers>
         <layout>
            <updates>
                <module>
                    <file>module.xml</file>
                </module>
            </updates>
        </layout>      
    </frontend>
</config>

My TestifrontController.php code

<?php
class Urban_Module_TestifrontController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
    $this->loadLayout();      

    $this->renderLayout();
   echo 'hello frontend';

    }
}

My module.xml code

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    </default>
    <module_testifront_index>
        <reference name="content">
            <block type="module/module" name="module" template="module/module.phtml"/>
        </reference>
    </module_testifront_index>
</layout>  

This module.xml path i have used is app/design/frontend/[package]/default/layout/module.xml . I have the module.phtml file in app/design/frontend/[package]/default/template/module/module.phtml.

The controller works when I navigate to index.php/module/testifront/index but the layout doesn't seem to work.

3

Your module does not define any blocks, but you use the block type "module/module"

You probably want to replace that with "core/template"

3

I see you're missing blocks node in your config.xml. Add code given below inside global node

<blocks>
    <module>
        <class>Urban_Module_Block</class>
    </module>  
</blocks>

and create block file Module.php which will go inside Urban/Module/Block folder.

In case if you're not going to write your own block functions, your can use block type as block core/template as suggested by fschmengler.

Module.php code will be like this

<?php
class Urban_Module_Block_Module extends Mage_Core_Block_Template
{
//your code here.
}

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.