/** Get reverse types * @access public * @return mixed */ public function revtypesAction() { if ($this->getParam('term', false)) { $types = new RevTypes(); $type_options = $types->getTypes($this->getParam('term')); if ($type_options) { $response = $type_options; } else { $response = array(array('id' => null, 'term' => 'No options available')); } } else { $response = array(array('id' => null, 'term' => 'No ruler specified')); } echo Zend_Json::encode($response); }