[PEPr] +1 for HTML::HTML_QuickForm2_Captcha

[email protected] ("Bertrand Mansion") Tue, 19 Mar 2013 21:54:31 +0000 (GMT)
Newsgroups php.pear.dev
Message-ID <[email protected]>
Bertrand Mansion (http://pear.php.net/user/mansion) has voted +1 on the proposal for HTML::HTML_QuickForm2_Captcha.

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=632
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=632&handle=mansion

Comment:

Here are some suggestions:

You can fill $this->data defaults in the properties of your class instead
of the constructor since you are just extending Input that does nothing
with them. (Like what you did for attributes).

$sessionPrefix could be set using the $data parameter.

The question should probably be the label ->setLabel()

Or maybe you should extend Container instead (my recommandation if you find
a way to do that, it's more flexible because then you can use the dom like
api to change the elements) and use $this->addStatic() and $this->addText()
depending on the elements you want to add.
I don't think it is a very good idea to add a div around these elements,
this should probably be left to the renderer.

If you use a Container, you can also use $attributes in the constructor
instead of $this->data['captchaHtmlAttributes']. Remember that all the
elements extend HTML_Common2 that has utility methods to deal with
attributes.

Recaptcha doesn't seem to need a session, maybe you should treat it as a
totally different element on its own instead of a subclass of Captcha.

Nevertheless, it is all useful as is, good work.