Skip to content

Instantly share code, notes, and snippets.

@howardpanton
Created April 3, 2012 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howardpanton/2290416 to your computer and use it in GitHub Desktop.
Save howardpanton/2290416 to your computer and use it in GitHub Desktop.
Tab test
<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