Welcome Guest, Not a member yet? Register   Sign In
auto_typography class error?

Slightly confused as having read up on this class/library - it's exactly what I need to format large text pulled from my database - however, the line breaks do no generate the desired results when the text is pulled from a variable.

$variable = "This is a \n paragraph";

HTML source code:

<p>This is a \n paragraph</p>

Am I missing something?

use <br> instead. html does not read \n

Ensure you have loaded the helper class in the autload.php or in the controller and use it like below in your controller.

$string = "Line 1 \nLine2";
$data['string'] = $this->typography->auto_typography($string);

$this->load->view('view', $data);

In the view you can use the variable $string.

Theme © iAndrew 2016 - Forum software by © MyBB