Write hyperlink inside the Zend Form?

后端 未结 5 1565
无人及你
无人及你 2020-12-29 07:50

I am using Zend-Framework in my project. I made a login form using the Zend Form that contains the User Id and Passwords fields with a submit button. Everything is

5条回答
  •  醉酒成梦
    2020-12-29 08:51

    I've faced the same problem before, and solved it by creating a custom Zend_Form_Element_Html, as follows:

    class Zend_Form_Element_Html 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;
        }
    }
    

    So, in your form you just have to do the following:

    $tag = new Zend_Form_Element_Html('forgetPassword');
    $tag->setValue('Forgotten your password?');
    $this->addElement($tag);
    

    Hope this helps!

提交回复
热议问题