Xml Magento:未显示完整操作名称句柄

Xml Magento:未显示完整操作名称句柄,xml,magento,layout,magento-1.7,Xml,Magento,Layout,Magento 1.7,我试图通过页面上的Mage_Core_Block_文本块添加字符串。 这是我的档案: 以下是包布局XML更新文件local.XML(在所有其他句柄应用于包布局XML后调用last): 这是我模块中的config.xml: /var/www/magpractice/app/code/local/Alanstormdotcom/Helloworld/etc/config.xml <config> <modules> <Alanstormdotcom_Hel

我试图通过页面上的Mage_Core_Block_文本块添加字符串。 这是我的档案:

以下是包布局XML更新文件local.XML(在所有其他句柄应用于包布局XML后调用last):

这是我模块中的config.xml:

/var/www/magpractice/app/code/local/Alanstormdotcom/Helloworld/etc/config.xml

<config>
  <modules>
    <Alanstormdotcom_Helloworld>
      <version>0.1.0</version>
    </Alanstormdotcom_Helloworld>
  </modules>
  <global>
    <blocks>
        <helloworld>
            <class>Alanstormdotcom_Helloworld_Block</class>
        </helloworld>
    </blocks>
  </global>
  <frontend>
    <routers>
      <helloworld>
        <use>standard</use>
        <args>
          <module>Alanstormdotcom_Helloworld</module>
          <frontName>helloworld</frontName>
        </args>
      </helloworld>
    </routers>
  </frontend>
</config>
/var/www/magpracture/app/code/local/alanstromdotcom/Helloworld/etc/config.xml
0.1.0
Alanstormdotcom_Helloworld_街区
标准
Alanstormdotcom_Helloworld
地狱世界
就我收集的信息而言,本例不需要指定块目录下的特殊块

当我转到http://localhost/magpracture/helloworld/index/index时,我会看到一个空白页面

如果我替换。。。与

为什么??我错过了什么


谢谢。

您的
索引方法似乎缺少对
loadLayout
renderLayout
的调用

$this->loadLayout();
$this->renderLayout();
loadLayout
方法解析XML并实例化块对象

renderLayout
方法调用根块上的
toHtml
方法


此外,删除
var\u转储(\uu方法\uu)也很有帮助编码到控制器操作中,以确保它确实被调用(与空白页相比,空白页可能意味着许多不同的东西)

谢谢。我被/var/www/magpracture/app/code/core/Mage/core/controllers/IndexController.php是空的这一事实所欺骗,但这可能是因为它不打算用作派生控制器。(?)认为我可以对派生的控制器进行类似的编码。我错了。不管怎么说,现在我看到“你好火星”被甩到了页面的中间。
/var/www/magpractice/app/code/local/Alanstormdotcom/Helloworld/etc/config.xml

<config>
  <modules>
    <Alanstormdotcom_Helloworld>
      <version>0.1.0</version>
    </Alanstormdotcom_Helloworld>
  </modules>
  <global>
    <blocks>
        <helloworld>
            <class>Alanstormdotcom_Helloworld_Block</class>
        </helloworld>
    </blocks>
  </global>
  <frontend>
    <routers>
      <helloworld>
        <use>standard</use>
        <args>
          <module>Alanstormdotcom_Helloworld</module>
          <frontName>helloworld</frontName>
        </args>
      </helloworld>
    </routers>
  </frontend>
</config>
$this->loadLayout();
$this->renderLayout();