public function rulerdenomAction() { if ($this->_getParam('term', false)) { $denominations = new Denominations(); $data = $denominations->getRomanRulerDenom($this->_getParam('term')); if ($data) { $response = $data; } else { $response = array(array('id' => NULL, 'term' => 'No options available')); } } else { $response = array(array('id' => NULL, 'term' => 'No ruler specified')); } $data = Zend_Json::encode($response); echo Zend_Json::prettyPrint($data, array("indent" => " ", 'format' => 'html')); }