Location: PHPKode > scripts > ApPHP Tabs > code_example.php
<html>
<head>
 <link href="style/style.css" rel="stylesheet" type="text/css" />
 </head>
 <body>
<?php

   ## +---------------------------------------------------------------------------+
   ## | 1. Creating Tabs:                                                    |
   ## +---------------------------------------------------------------------------+
   //include tab class
   require_once("tab.class.php");

   //create tabs object
   $tabs=new Tab("root");

   //parameters:
   //param #1 - text on the tab
   //param #2 - tab's parent
   //param #3 - graphic file associated with this tab
   //           "" is default value (i.e. no picture)
   //param #4 - sub-tab which will be selected by default
   //           "" is default value (i.e. the first sub-tab)
   //param #5 - is tab enabled or disabled
   //           true is default value

   $tabs->AddTab("Tab1","root");
   $tabs->AddTab("Tab2","root","","Subtab4");
   $tabs->AddTab("Subtab1","Tab1","Subtab1.jpg");
   $tabs->AddTab("Subtab2","Tab1","Subtab2.jpg");
   $tabs->AddTab("Subtab3","Tab2","Subtab3.jpg");
   $tabs->AddTab("Subtab4","Tab2","Subtab4.jpg");

   ## +---------------------------------------------------------------------------+
   ## | 2. Disabling Tabs:                                                         |
   ## +---------------------------------------------------------------------------+
   //$tabs->Disable("Subtab2");

   ## +---------------------------------------------------------------------------+
   ## | 3. Drawing Tabs:                                                         |
   ## +---------------------------------------------------------------------------+
   $tabs->View();
?>
</body></html>
Return current item: ApPHP Tabs