Zend Framework: Insert DIV and Image in my form

前端 未结 8 1835
伪装坚强ぢ
伪装坚强ぢ 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; 
        }
    
    }
    
    0 讨论(0)
  • 2020-12-19 23:08

    I usually use description with array(escape => false) option to render HTML in form.

    0 讨论(0)
提交回复
热议问题