Magento 块模板文件没有';你不叫我的控制器吗?

Magento 块模板文件没有';你不叫我的控制器吗?,magento,Magento,我可以发布我的代码。它的工作控制器和块文件,但模板文件不工作 在这里发送代码 <?xml version="1.0" ?> <!-- /** * Module Configuration * *@author Magento --> <config> <modules> <Magentostudy_News> <version>1.0.0</version>

我可以发布我的代码。它的工作控制器和块文件,但模板文件不工作

在这里发送代码

 <?xml version="1.0" ?>
<!--
/**
* Module Configuration
*
*@author Magento
-->
<config>
    <modules>
        <Magentostudy_News>
        <version>1.0.0</version>
        </Magentostudy_News>
    </modules>
    <frontend>
        <routers>
            <magentostudy_news>
                <use>standard</use>
                <args>
                <module>Magentostudy_News</module>
                <frontName>news</frontName>
                </args>
            </magentostudy_news>
        </routers>
    </frontend>
    <layout>
            <updates>
            <magentostudy_news>
            <file>news.xml</file>
            </magentostudy_news>
            </updates>
    </layout>

    <global>
         <blocks>
                <news><class>Magentostudy_News_Block</class></news>
         </blocks>

    </global>

</config>

1.0.0
标准
麦根图新闻
新闻
news.xml
麦根图新闻组
mynews.xml文件

    <layout version="0.1.0">
<default>
    <reference name="content"></reference>
</default>
<news_index_index>
    <reference name="content">

    <block type="news/news" name="news.slider" template="news/news.phtml"></block>

    </reference>

</news_index_index>
<layout>

这是我的控制器文件

    <?php

class Magentostudy_News_IndexController extends Mage_Core_Controller_Front_Action{

    public function _construct(){


      Mage::app()->loadArea($this->getLayout()->getArea());

        $this->loadLayout();
        $this->renderLayout();


    }

    public function indexAction(){


       $cpBlock = $this->getLayout()->getBlockSingleton('Magentostudy_News_Block_News');

    }

}

?>

这是我的块文件

    <?php

class Magentostudy_News_Block_News extends Mage_Core_Block_Template{

    public function _construct()
    {
        parent::_construct();

        $this->setTemplate('news/news.phtml'); 
    }



}

?>


告诉我此文件中的问题类型?如何解决呢?

您没有在
索引()中加载和呈现布局。应该是这样的

<?php
public function indexAction() {
    $this->loadLayout();
    //your custom changes should do here
    $this->renderLayout();
}