CodeIgniter Forums
nl2br with template parser - 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: nl2br with template parser (/showthread.php?tid=44678)



nl2br with template parser - El Forum - 08-23-2011

[eluser]senjy[/eluser]
Hi,

I want to know how can i user "library template parser" and display correct data with br.

Controller
Code:
$this->localdb->where('id',$id);
$query = $this->localdb->get('memo');
$data = array(
'liste' => $query->result_array()
);
$this->load->view('memo/detail', $data);

template
Code:
<table border =1>
    {liste}
    <tr>
    <td><a href="memo/view/{id}"></a>
         <b>{date_update} - {titre}</b></td></tr>
    <tr>
    <td>
        &lt;?php echo nl2br({description})?&gt;</td>
    </tr>
    {/liste}
</table>

This code don't work :-(
Code:
&lt;?php echo nl2br({description});?&gt;


Hope you can help.