在Magento中新建一个插件的时候,如何控制我们前台页面的页面结构呢?一个方法是去修改我们的模板XML文件来实现。另一个办法就是在我们插件的Controller(控制器)中来设置Magento的页面结构。代码如下:
$this->loadLayout();$this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
$this->renderLayout();
在block中设置template
protected function _construct()
{
parent::_construct();
$this->setTemplate('moneybookers/form.phtml');
}