【发布时间】:2014-02-11 12:04:08
【问题描述】:
我正在尝试创建自定义 Magento 管理页面,但我似乎无法让我的布局或模板出现在页面中。该页面在菜单中显示得很好,但是当您单击它时,您只会得到一个空白的管理页面。我遵循了一些不同的教程,并且至少完成了整个过程两次,但无法弄清楚为什么我的模板没有出现。 You can download all the source here.
【问题讨论】:
标签: xml magento templates layout
我正在尝试创建自定义 Magento 管理页面,但我似乎无法让我的布局或模板出现在页面中。该页面在菜单中显示得很好,但是当您单击它时,您只会得到一个空白的管理页面。我遵循了一些不同的教程,并且至少完成了整个过程两次,但无法弄清楚为什么我的模板没有出现。 You can download all the source here.
【问题讨论】:
标签: xml magento templates layout
在 Saxx_Forzani_Block_Adminhtml_Forzani 你可以做
public function __construct()
{
parent::__construct();
$this->setTemplate('forzani/admincontent.phtml');
}
然后你可以在控制器中做
public function indexAction()
{
$this->_initAction()
->_addContent($this->getLayout()->createBlock('saxx_forzani/adminhtml_forzani'))
->renderLayout();
}
【讨论】: