Created
April 3, 2012 08:22
-
-
Save howardpanton/2290416 to your computer and use it in GitHub Desktop.
Tab test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Testing PHP Tabs</h1> | |
<?php | |
$links = array(); | |
$texts = array(); | |
// Add items to array | |
<t4 type="navigation" id="627"/> | |
echo "<div class='tabbable'><ul class='nav nav-tabs'>"; | |
foreach ($links as $key => $link) { | |
if ($key === 0) { | |
echo "<li class='active'>"; | |
echo "<a href='#" . $key . "'data-toggle='tab'>" . $link . "</a>"; | |
echo "</li>"; | |
} | |
else { | |
echo "<li class>"; | |
echo "<a href='#" . $key . "'data-toggle='tab'>" . $link . "</a>"; | |
echo "</li>"; | |
} | |
} | |
echo "</ul></div>"; | |
echo "<div class='tab-content'>"; | |
foreach ($texts as $key => $text) { | |
if ($key === 0) { | |
echo "<div class='tab-pane active' id='" . $key . "'>"; | |
echo $text; | |
echo "</div>"; | |
} | |
else { | |
echo "<div class='tab-pane' id='" . $key . "'>"; | |
echo $text; | |
echo "</div>"; | |
} | |
} | |
echo "</div>"; | |
echo "</div>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment