Log in

View Full Version : need help with conditionals in a template


TalkVirginia
10-13-2009, 04:37 AM
I need to display a list of warnings captured in an array.. how would I show them in a template? I'm thinking I would need a warnings template. I'm kinda stuck on the sizeof part though.


if ($isAdmin && is_array($warnings) && sizeof($warnings) > 0) {
echo '<div id="warnings">';
foreach ($warnings as $warning) {
echo $warning;
}
echo '</div>';
}


Warnings Template:


<div id="warnings">$warning</div>

Lynne
10-13-2009, 02:37 PM
eval('$my_warnings .= " ' . fetch_template('Warning') . '";');