[eluser]Mike Cocklin[/eluser]
[quote author="techgnome" date="1286696374"]Or... do it on the way back out of the database. I prefer to store the raw text in the database... makes editing easier later... then do the html encoding when displaying it.
-tg[/quote]
I prefere that idea. How do i do this on the way out?
What i mean is, this field becomes part of an array in my controller
Code:
$data['monthlyTheme'] = $this->newspaper_model->GetThisTheme($options = array('theme_date' => $thisMonth, 'theme_group_id' => $theme_group_id));
in my view it is displayed in a for each loop
Code:
<?php if(isset($monthlyTheme) && is_array($monthlyTheme) && count($monthlyTheme)>0):?>
<?php foreach($monthlyTheme as $item ): ?>
<p class="firstpara"><?php echo $item->theme_texta;?></p>
<p class="standardpara"><?php echo $item->theme_textb;?></p>
<?php endforeach; ?>
<?php else: ?>
<span style="color:white">Awaiting Theme</span>
<?php endif; ?>
Many thanks