Welcome Guest, Not a member yet? Register   Sign In
How to keep paragraph breaks
#4

[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">&lt;?php echo $item->theme_texta;?&gt;</p>
<p class="standardpara">&lt;?php echo $item->theme_textb;?&gt;</p>
&lt;?php endforeach; ?&gt;
&lt;?php else: ?&gt;
<span style="color:white">Awaiting Theme</span>
&lt;?php endif; ?&gt;

Many thanks


Messages In This Thread
How to keep paragraph breaks - by El Forum - 10-09-2010, 12:59 PM
How to keep paragraph breaks - by El Forum - 10-09-2010, 01:09 PM
How to keep paragraph breaks - by El Forum - 10-09-2010, 08:39 PM
How to keep paragraph breaks - by El Forum - 10-09-2010, 09:13 PM
How to keep paragraph breaks - by El Forum - 10-09-2010, 09:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB