magento load phtml in admin


magento load phtml in admin

首先对不起我的英语很糟糕。

我正在尝试研究洋红色。问题是在管理面板中加载PHTML文件。在菜单中,链接还可以,但我加载了一个空白页面。BLOK 没问题,因为如果我加载字体就可以了。

这是我的文件:

/

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>

PHTML 是可以的,并且是:

/

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

你在这里缺少参考

<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>