Zend Framework

Zend_Captcha_Image always has <br/> in rendered element

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.10.0
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Captcha
  • Labels:
    None

Description

At the moment it is not possible to put the input text field of an Zend_Form_Element_Captcha besides the captcha image with css for example.

The generated code looks like this:

<img src="/images/captcha/f2fa4b159345bf3bd7ab7268349aa11a.png"/><br/>
<input type="hidden" name="verific[id]" value="f2fa4b159345bf3bd7ab7268349aa11a" id="verific-id">
<input type="text" name="verific[input]" id="verific-input" value="">

The render() method looks like this at the moment:

public function render(Zend_View_Interface $view = null, $element = null)
{
    return '<img width="'.$this->getWidth().'" height="'.$this->getHeight().'" alt="'.$this->getImgAlt().'" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"/><br/>';
}

So there is always a <br/> in it which makes it hard to change the appearance with css.

The <br/> should not be hardcoded and the output should be more flexible, so a developer can put the textfield right beside the Image.

At the moment I changed that behaviour by extending Zend_Captcha_Image and changing the render() method.

Activity

Hide
Martin de Keijzer added a comment -

Totally agree, created a patch to simplify update

Show
Martin de Keijzer added a comment - Totally agree, created a patch to simplify update
Hide
Mickael Perraud added a comment -

Fixed on trunk with r22583 and merge into 1.10 branch with r22584

Show
Mickael Perraud added a comment - Fixed on trunk with r22583 and merge into 1.10 branch with r22584

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: