public function rulerdenomearlymedAction() { if ($this->_getParam('term', false)) { $denominations = new Denominations(); $denom_options = $denominations->getEarlyMedRulerDenom($this->_getParam('term')); if ($denom_options) { echo Zend_Json::encode($denom_options); } else { $data = array(array('id' => '', 'term' => 'No options available')); echo Zend_Json::encode($data); } } else { $response = array(array('id' => NULL, 'term' => 'No ruler specified')); echo Zend_Json::encode($response); } }