Entwickler Handbuch

Füge das Captcha zu deinem domain model hinzu

Füge dieses Feld deiner domain model Klasse hinzu:

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

und getter und setter Funktionen:

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

/**
 * Returns the captchaResponse
 *
 * @return string
 */
public function getCaptchaResponse() {
    return $this->captchaResponse;
}

Füge das Captcha zu deinem Fluid template hinzu

1
2
3
4
{namespace jhcaptcha = Haffner\JhCaptcha\ViewHelpers}

<jhcaptcha:reCaptcha />
<f:form.textfield id="captchaResponse" type="hidden" property="captchaResponse" />