PHP code example of gearmagicru / gm-wd-kcaptcha

1. Go to this page and download the library: Download gearmagicru/gm-wd-kcaptcha library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gearmagicru / gm-wd-kcaptcha example snippets


$captcha = Gm::$app->widgets->get('gm.wd.kcaptcha', ['width' => 100, 'height' => 70]);
$captcha->run();

echo $this->widget('gm.wd.kcaptcha', ['width' => 100, 'height' => 70]);

use Gm\Widget\KCaptcha\Widget as KCaptcha;
(new KCaptcha(['width' => 100, 'height' => 70]))->render();

$captcha = Gm::$app->widgets->get('gm.wd.kcaptcha', ['toHtml' => true]);
$captcha->run();
// результат: <img src="data:image/png;base64..." />

use Gm\Widget\KCaptcha\Widget as KCaptcha;
echo KCaptcha::widget(['width' => 100, 'height' => 70]);