
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.50 KB | hits: 13 | expires: Never
How to save Line-breaks in DB and display them in View with Zend Framework
$this->escape($entry->description)'
echo nl2br($entry->description)
$db = Zend_Db_Table::getDefaultAdapter();
$db->insert('testing', array('description' => "This is a testnwith multiplenlines in the dbnnmore stuff"));
$select = $db->select()->from('testing');
$results = $select->query();
$row = $results->fetch();
$this->view->description = $row['description'];
// in the view:
echo nl2br($this->description);