public function medmintrulerAction() { if ($this->_getParam('term', false)) { $ruler = $this->_getParam('term'); $mints = new Mints(); $mint_options = $mints->getEarlyMedMintRuler($this->_getParam('term')); if ($mint_options) { echo Zend_Json::encode($mint_options); } else { if ($ruler == NULL) { $data = array(array('id' => NULL, 'term' => 'No options available')); echo Zend_Json::encode($data); } else { $data = array(array('id' => NULL, 'term' => 'No options available')); echo Zend_Json::encode($data); } } } else { $error = array(array('id' => '', 'term' => 'No ruler specified')); echo Zend_Json::encode($error); } }