/** * @throws Zend_Form_Exception */ public function init() { parent::init(); $this->addPrefixPath('Application_Form_Decorator', 'Application/Form/Decorator', Zend_Form::DECORATOR); $this->setMultiOptions($this->getLanguageOptions()); $this->setRequired(true); $this->setAutoInsertNotEmptyValidator(false); // custom error message $this->setRegisterInArrayValidator(false); $options = $this->getMultiOptions(); $this->addValidator('InArray', true, array('messages' => array(Zend_Validate_InArray::NOT_IN_ARRAY => 'validation_error_language_not_supported'), 'haystack' => array_keys($options))); $this->setAllowEmpty(false); // there must be a value }
public function init() { parent::init(); $this->addPrefixPath('Application_Form_Decorator', 'Application/Form/Decorator', Zend_Form::DECORATOR); $this->setMultiOptions($this->getRolesMultiOptions()); }