CodeIgniter Forums
Template parser class adds extra newlines - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Template parser class adds extra newlines (/showthread.php?tid=13539)



Template parser class adds extra newlines - El Forum - 11-26-2008

[eluser]Unknown[/eluser]
If $table equals array(array('key' => 1), array('key' => 2)) then
Code:
<p>
&lt;?php foreach ($table as $row) { ?&gt;
&lt;?php echo $row['key']; ?&gt;<br />
&lt;?php } ?&gt;
</p>
produces
Code:
<p>
1<br />
2<br />
</p>
whereas
Code:
<p>
{table}
{key}<br />
{/table}
</p>
is substituted with
Code:
<p>

1<br />

2<br />

</p>

I have a simple patch that fixes the problem if you are interested.


Regards,

August