I have already encountered this problem, but I can’t remember how to solve it. I created a simple (I can’t get a simpler) controller and just try to repeat something in the browser, and I get this message:
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Session must be started before any output has been sent to the browser ...
Here is my one-piece controller. It displays "success" but also displays an error message. How to disable this error message so that I can just repeat something in the browser?
<?php
class CacheController extends Zend_Controller_Action
{
public function clearAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
try {
$result = Model_Cache::emptyCache(array('foobar'=>1));
if ($result['status'] == true) {
echo 'Success';
} else {
echo 'Error: ' . $result['message'];
}
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
}
source
share