dravencms/icaptcha

Captcha interface for dravencms

Maintainers

Package info

github.com/dravencms/icaptcha

pkg:composer/dravencms/icaptcha

Transparency log

Statistics

Installs: 106

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

0.0.2 2024-08-11 14:33 UTC

This package is auto-updated.

Last update: 2026-08-24 22:38:56 UTC


README

Provider contracts shared by the DravenCMS CAPTCHA integration and its concrete adapters. Applications normally install dravencms/captcha and one provider rather than using this library directly.

Contracts

  • ICaptchaProvider creates a form field through prepareField().
  • ICaptchaField extends the Nette Forms control contract with verify() and the methods needed for validation and rendering.

Installation

composer require dravencms/icaptcha

Implementing a Provider

Implement Dravencms\Captcha\ICaptchaProvider and return a control implementing Dravencms\Captcha\Forms\ICaptchaField:

final class CaptchaProvider implements ICaptchaProvider
{
    public function prepareField(string $label, ?string $message = null): ICaptchaField
    {
        return new CaptchaField($this, $label, $message);
    }
}

Provider packages should expose their implementation as a DI service and declare that they provide dravencms/captcha-implementation in Composer metadata.

License

This package is licensed under the LGPL-3.0 license.