Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在magento自定义模块中创建多个选项卡?_Magento_Tabs - Fatal编程技术网

如何在magento自定义模块中创建多个选项卡?

如何在magento自定义模块中创建多个选项卡?,magento,tabs,Magento,Tabs,如何在管理端创建多个水平和垂直选项卡式的类别页面,并将数据保存在数据库中 我想在表单中添加垂直选项卡,只需在_beforeToHtml()函数中的模块的tabs.php文件中添加以下代码即可 只要给tabid任何您想要的,并在url中给action name添加这个函数,也可以在您的tabs.php文件中为handle tab update添加这个函数 并调用$this->_updateActiveTab();函数中的_beforeToHtml() 在控制器中添加如下操作 public func

如何在管理端创建多个水平和垂直选项卡式的类别页面,并将数据保存在数据库中

我想在表单中添加垂直选项卡,只需在_beforeToHtml()函数中的模块的tabs.php文件中添加以下代码即可

只要给tabid任何您想要的,并在url中给action name添加这个函数,也可以在您的tabs.php文件中为handle tab update添加这个函数 并调用$this->_updateActiveTab();函数中的_beforeToHtml()

在控制器中添加如下操作

public function yourAction() 
{
    $id = (int) $this->getRequest()->getParam('id');
    $model = Mage::getModel('modulename/modulename');

    if ($id) {
        $model->load($id);
    }

    Mage::register('modulename_data', $model);

    $this->getResponse()->setBody($this->getLayout()
      ->createBlock('modulename/adminhtml_modulename_edit_tab_tabid')->toHtml());
}  

你试过什么吗?你有工作模块吗?你很有帮助
protected function _updateActiveTab()
{
    $tabId = $this->getRequest()->getParam('tab');
    if ($tabId) {
        $tabId = preg_replace("#{$this->getId()}_#", '', $tabId);
        if ($tabId) {
            $this->setActiveTab($tabId);
        }
    }
    else {
       $this->setActiveTab('form_section'); 
    }
}
public function yourAction() 
{
    $id = (int) $this->getRequest()->getParam('id');
    $model = Mage::getModel('modulename/modulename');

    if ($id) {
        $model->load($id);
    }

    Mage::register('modulename_data', $model);

    $this->getResponse()->setBody($this->getLayout()
      ->createBlock('modulename/adminhtml_modulename_edit_tab_tabid')->toHtml());
}