Developer Corner

Note

This section is outdated & may no longer work. Due to time constraints it is currently not planned to to update this section. Create a PR if necessary.

Add the Captcha to your domain model

Add this field to your domain model class:

1/**
2 * @var string
3 * @validate NotEmpty, \Haffner\JhCaptcha\Validation\Validator\ReCaptchaValidator
4 */
5protected $captchaResponse;

and getter and setter functions:

 1/**
 2 * Sets the captchaResponse
 3 *
 4 * @param string $captchaResponse
 5 * @return void
 6 */
 7public function setCaptchaResponse($captchaResponse) {
 8    $this->captchaResponse = $captchaResponse;
 9}
10
11/**
12 * Returns the captchaResponse
13 *
14 * @return string
15 */
16public function getCaptchaResponse() {
17    return $this->captchaResponse;
18}

Add the Captcha to your Fluid template

1{namespace jhcaptcha = Haffner\JhCaptcha\ViewHelpers}
2
3<jhcaptcha:reCaptcha />
4<f:form.textfield id="captchaResponse" type="hidden" property="captchaResponse" />