captcha() form()
A captcha image with its input; the field is required and checked by the captcha validation rule.
form()->captcha($name = '', $desc = '', $extra = [], $replace = [])Options
| Option | Meaning |
|---|---|
$name | Default captcha. |
class, style, placeholder, size | Attributes of the input. |
Example
Code
return form()
->email()
->captcha();Notes
- The image comes from
/dynamic/captcha_image; the answer is kept in the session. - Validate with the
captcharule:validate(['captcha' => 'captcha']).
See also: form/validate, demo:form/captcha