调用管理模板控制器函数

Calling admin template controller function

我在 Magento 管理中创建了一个菜单:-

这是我为 magento admin 渲染布局的代码:-

<?php

class ActiveCodeline_SampleModule1_ExampleController extends Mage_Adminhtml_Controller_Action
{

    public function indexAction()
    {
     $this->loadLayout();
        $this->renderLayout();
    } 
}

现在我想做的是为这个创建的菜单加载一个自定义模板文件,或者你可以说我想显示内容。

我该怎么做。

基本上你想在点击控制器后加载模板文件。 在您拥有自定义文件的布局文件夹中,在相应的布局文件中,您需要声明 .phtml 文件,它只是一个 html 文件。

<frontname_example_index>
<reference name="content">
<block type="namespace_module/frontname" name="frontname"
            template="namespace/frontname/view.phtml" />
    </reference>
</frontname_example_index>