I can't seem to get my controllers to recognize that I only want them
to display json. Here's my controller
<?php
class IndexController extends Zend_Controller_Action {
public function init() {
$this->_helper->contextSwitch()
->clearContexts()
->clearActionContexts()
->setDefaultContext('json')
->initContext('json');
}
public function indexAction() {
$this->view->assign(array(
'status' => 'ok',
'message' => 'This is the index action'
));
}
}
?>
All I want to do is, by default, output everything as json. I don't
want to have to send a "format=json" parameter in the URL.
According to
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html
I should be able to do this, but the above controller results in the
error
Fatal error: Uncaught exception 'Zend_View_Exception' with message
'script 'error/error.phtml' not found in path
What am I missing?
Thanks,
Tim