I have a module called api that I would like to flatly disable all rendering and layout and only return JSON. I know I can disable layouts per action in a controller like so:
$this->_helper->_layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(TRUE);
But how can I do it on the entire api module?
Solution: Put this in it's own controller and have all the other controllers extend this:
public function preDispatch() {
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}