I want to print the $tabs array in Drupal 7.
So, I´ve tried adding this code inside my node.tpl.php:
<?php
echo '<div class="btn-group">';
foreach($tabs as $tab=>$link) {
echo '<button class="btn"><a href="$link">$tab</a></button>';
};
echo '</div>';
?>
But, it´s not printing anything… so I´m sure this is somewhat wrong.
Maybe because this should be inside the page.tpl.php? Is there a syntax problem that I didn´t catch?
Thanks for your help!!
Rosamunda
One problem that I see is that you are attempting to print variables that are contained inside of single quotes. PHP does not interpolate variables inside of single quotes, but it will inside of double quotes. Try changing your echo to this:
From the manual:
For more information see the manual entry for Strings