public function romandenomrulerAction() { if ($this->_getParam('term', false)) { $rulers = new Rulers(); $ruler_options = $rulers->getRomanDenomRuler($this->_getParam('term')); if ($ruler_options) { echo Zend_Json::encode($ruler_options); } else { $data = array(array('id' => NULL, 'term' => 'No options available.')); echo Zend_Json::encode($data); } } else { $response = array(array('id' => NULL, 'term' => 'No ruler specified')); echo Zend_Json::encode($response); } }