public function getoptionsAction() { $data = array(); // 请求参数 $request = $this->getRequest()->getParams(); $type = isset($request['type']) ? $request['type'] : null; $options = new Admin_Model_Options(); $data = $options->getList($type); echo Zend_Json::encode($data); exit; }
/** * Configures form and creates form elements. */ public function init() { parent::init(); $options = new Admin_Model_Options(); $this->_options = $options->getOptions(); foreach ($this->_options as $name => $option) { $section = $option->getSection(); $element = $this->createElement($option->getElementType(), $name, array_merge(array('label' => $option->getLabel(), 'description' => $option->getDescription()), $option->getOptions())); $this->addElement($element); $this->addElementToSection($element, $section); } $this->removeElement(self::ELEMENT_MODEL_ID); }