To create a custom tab for a module during installation you can use the following code.
Note: I am considering a test module called News.
private function _createTab()
{
/* define data array for the tab */
$data = array(
'id_tab' => '',
'id_parent' => 7,
'class_name' => 'AdminNews',
'module' => 'news',
'position' => 1, 'active' => 1
);
/* Insert the data to the tab table*/
$res = Db::getInstance()->insert('tab', $data);
//Get last insert id from db which will be the new tab id
$id_tab = Db::getInstance()->Insert_ID();
//Define tab multi language data
$data_lang = array(
'id_tab' => $id_tab,
'id_lang' => Configuration::get('PS_LANG_DEFAULT'),
'name' => 'News'
);
// Now insert the tab lang data
$res &= Db::getInstance()->insert('tab_lang', $data_lang);
return true;
} /* End of createTab*/
I hope the above code will help Thanks