Zend Framework: Insert DIV and Image in my form

前端 未结 8 1877
伪装坚强ぢ
伪装坚强ぢ 2020-12-19 22:30

I need to insert html code like this in my zend form:

8条回答
  •  伪装坚强ぢ
    2020-12-19 23:01

    If you're creating a form element, I think you have to override the isValid() method, as in the code below, or your "value" will disappear upon a validation error:

    class RenomoZF_Form_Element_Note extends Zend_Form_Element_Xhtml
    {
        /**
         * Default form view helper to use for rendering
         * @var string
         */
        public $helper = 'formNote';
    
        public function isValid($value, $context = null) {
          return TRUE; 
        }
    
    }
    

提交回复
热议问题