我当前正在尝试将块添加到自定义Adminhtml模块。我能够显示块的内容,但是它以灰色背景在页面的顶部呈现,然后是设计和菜单直接在底下呈现的标准magento布局。将块添加到magento adminhtml模块
即时尝试以正确的方式做事情,以了解最佳做法,并遵循书籍和教程以及magento核心,但迄今为止一直无法正确添加内容。
到目前为止,我有:
public function indexAction()
{
$this->loadLayout();
$this->_setTitle();
$main_block = new Invent_General_Block_Info();
echo $main_block->toHtml();
//$this->_addContent($main_block);
$this->renderLayout();
我能看到的一般方式在法师核心这样做会是这样的
/**
* Append customers block to content
*/
$this->_addContent(
$this->getLayout()->createBlock('adminhtml/customer', 'customer')
);
,因为我已经创建了块$ main_block它对我来说没有意义 - > createBlock,所以我不知道该从这里做什么。
像往常一样赞赏任何帮助。谢谢!
嗨感谢您的建议,但这并没有奏效,因为我没有通过CMS创建块,但已经这样编程。 – activeDev