简体   繁体   中英

magento load phtml in admin

First sorry for my realy bad english.

I'm tryng to study magento. The problem is load PHTML file in admin panel. In menu the link is ok but I load a blank page. The BLOK is ok becaus if I load in font and it's OK.

This is my file:

/app/code/local/Package/HelloWorld/etc/config.xml

  <admin>
        <routers>
            <helloworld><!-- nome modulo -->
                <use>admin</use>
                <args>
                    <module>Package_HelloWorld</module> <!-- namespace -->
                    <frontName>admintest</frontName><!-- path-->
                </args>
            </helloworld>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <helloworld>
                    <file>helloworld.xml</file><!-- file di layout, ricordiamoci che sta in /app/design/adminhtml/default/-->
                </helloworld>
            </updates>
        </layout>
        <menu><!-- aggiungo al menu del pannello-->
            <helloworld translate="title" module="adminhtml">
                <title>The Nano </title>
                <sort_order>100</sort_order>
                <children>
                    <set_time>
                        <title>Leggo da db</title>
                        <action>admintest/adminhtml_index</action>
                    </set_time>
                </children>
            </helloworld>
        </menu>
    </adminhtml>

/app/design/adminhtml/default/Package/layout/helloworl.xml

<layout version="0.1.0">
    <helloworld_adminhtml_index_index>
        <default name="content">
            <block type="nomeblocco/nomebloccointerno" name="helloworld_scheda"    template="helloworld/scheda.phtml"/>
        </default>
    </helloworld_adminhtml_index_index>
</layout>

the PHTML is ok and is:

/app/design/adminhtml/default/Package/template/helloworl/scheda.phtml

You have missing reference here

<layout version="0.1.0">
    <helloworld_adminhtml_index_index>
        <reference name="content">
            <block type="nomeblocco/nomebloccointerno" name="helloworld_scheda"    template="helloworld/scheda.phtml"/>
        </reference>
    </helloworld_adminhtml_index_index>
    </layout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM