How To Create Page in Admin Panel

Our Namespace is Guides and module name is Films.

Modules config.xml

<config>
    <modules>
        <Guides_Films>
            <version>0.1.0</version>
        </Guides_Films>
    </modules>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <films before="Mage_Adminhtml">Guides_Films_Adminhtml</films>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <films>
                    <file>guides_films.xml</file>
                </films>
            </updates>
        </layout>
    </adminhtml>
    <global>
        <blocks>
            <guides_films>
                <class>Guides_Films_Block</class>
            </guides_films>
        </blocks>
        <helpers>
            <guides_films>
                <class>Guides_Films_Helper</class>
            </guides_films>
        </helpers>
    </global>
</config>

Modules adminhtml.xml

<config>
    <menu>
        <guides translate="title" module="guides_films">
            <title>Guides Menu</title>
            <sort_order>100</sort_order>
            <children>
                <films translate="title" module="guides_films">
                    <title>Films</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/film/index</action>
                </films>
            </children>
        </guides>
    </menu>
</config>

Helper Data.php

<?php

class Guides_Films_Helper_Data extends Mage_Core_Helper_Abstract {

}

Block Movieblock.php

<?php
class Guides_Films_Block_Movieblock extends Mage_Core_Block_Template
{
    public function methodblock() {
        return 'test from method block';
    }
}

Controllers/Adminhtml/FilmController.php

<?php

class Guides_Films_Adminhtml_FilmController extends Mage_Adminhtml_Controller_Action {

  public function indexAction() {
    $this->loadLayout();
    $this->renderLayout();

  }

}

app/design/adminhtml/default/default/layout/guides_films.xml

<layout version="1.0">

    <adminhtml_film_index>

        <reference name="content">
            <block type="guides_films/movieblock" name="monblock" template="guides_films/movies.phtml" />
        </reference>
    </adminhtml_film_index>

</layout>

app/design/adminhtml/default/default/template/guides_films/movies.phtml

<h1>Hello World</h1>
<p>This is test from movies.phtml</p>
<?php echo $this->methodblock(); ?>

 


Lukas
Lukas Stranovsky
I am the guy who made this. Sorry for typos.