Implementation of quicktab by codes I am trying to add quick tabs from codes. I got the code from here Creating QuickTabs programmatically not working . But noone explains how to implement this , where to add the code. I am trying to add like this.

test.module

&lt;?php
    function test_menu(){

    $items['test/quicktabs'] = array(
        'title'=&gt; 'quicktabs',
        'page callback' =&gt; 'test_quicktabs',
        'access arguments' =&gt; array('access content'),
        'type' =&gt; MENU_CALLBACK,
      );
    return $items;
    }

    function test_quicktabs(){
    $tabs = array();

    $tabs[] = array(
      'title' =&gt; t('Tab1'),
      'type' =&gt; 'freetext',
      'text' =&gt; 'Hello wecome to Tab1',
    );
    $tabs[] = array(
      'title' =&gt; t('Tab2'),
      'type' =&gt; 'freetext',
      'text' =&gt; 'Hello wecome to Tab2',
    );
    $tabs[] = array(
      'title' =&gt; t('Tab3'),
      'type' =&gt; 'freetext',
      'text' =&gt; 'Hello wecome to Tab3',
    );

    // Configure the QuickTabs options
    $quicktabs_options = array(
       'style'   =&gt; 'Bullets',
       'ajax'    =&gt; FALSE,
    );

    $quicktabs_name = 'dynamic_quicktabs_menu';
    $quicktabs = quicktabs_build_quicktabs($quicktabs_name, $quicktabs_options, $tabs);
    return $quicktabs;

    }
?&gt;


I am not sure , this is a correct approach . How to implement quicktabs inside other modules?
I found the solution, As previously i was not using   'renderer'    =&gt; 'quicktabs', . Also 

 $tabs[] = array(
          'title' =&gt; t('Tab3'),
          'type' =&gt; 'freetext',
          'text' =&gt; 'Hello wecome to Tab3',
        );  


was not working.
Use this working function. 

function test_quicktabs(){



    $quicktabs_options = array(
        'style'   =&gt; 'Basic',
        'ajax'    =&gt; FALSE,
        'renderer'    =&gt; 'quicktabs',
    );

    $quicktabs_name = 'newinstance';

    $custom_tabs = array(
        array(
            'title' =&gt; 'Tab 1',
            'contents' =&gt; 'tab1',
            'weight' =&gt; -10
        ),
        array(
            'title' =&gt; 'Tab2',
            'contents' =&gt; 'tab2',
            'weight' =&gt; 0
        ));


   return  quicktabs_build_quicktabs($quicktabs_name, $quicktabs_options, $custom_tabs);

}


If anyone find better implementation using quicktabs hooks. Please do answer.