Understanding the layout of the xml layout file (link, block, ...)

I have some questions about the XML layout file that fits in app \ design \ adminhtml \ default \ default \ layout.

In some textbook he had this structure:

<layout>
    <adminhtml_example_index>
        <reference name="content">
            <block type="awesome/adminhtml_example" name="example" />
         </reference>
    </adminhtml_example_index>

    <adminhtml_example_edit>
        <reference name="content">
            <block type="awesome/adminhtml_example_edit" name="example_edit" />
        </reference>
    </adminhtml_example_edit>
</layout>

Can someone explain what these lines mean? The tutorial can be found here: here

Thank!

+5
source share
2 answers

The Magento- based XML structure seems a bit confusing and annoying in the beginning, but it is well known that it’s ultimately powerful and customizable ...

<adminhtml_example_index></adminhtml_example_index>

[] [] [] . admin config.xml adminhtml.

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <awesome before="Mage_Adminhtml">Super_Awesome_Adminhtml</awesome>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

, .

, url /admin/example/[index], magento , <adminhtml>, example , index (/admin/example/ )

<adminhtml_example_index>
    <reference name="content">
        <block type="awesome/adminhtml_example" name="example" />
    </reference>
</adminhtml_example_index>

. content, .

<block> , . <type> . , (, Magentos MVC phtml)

awesome/adminhtml_example awesome - , config.xml. adminhtml_example - , .

<global>
    -----
    <blocks>
        <awesome>
            <class>Super_Awesome_Block</class>
        </awesome>
    </blocks>
</global>

block ( ). Super/Awsome/Block/.

. adminhtml_example - , . (awesome) .

[codepool]/Super/Awsome/Block/Adminhtml/Example.php

class Super_Awesome_Block_Adminhtml_Example extends ….

, .. .phtml

<reference name="root">
    <block type="page/html" name="root" template="simplepage.phtml" />
</reference>

, ... , - ...

+13

MVC, ,

<adminhtml_example_index>, adminhtml/example/index controller

<reference name="content"> , content

:

+5

All Articles