Back to PhocacartCaptchaRecaptcha class

Method render

public static
render
()

Method render - Source code

public static function render()
{
    $document = Factory::getDocument();
    $pC = PhocacartUtils::getComponentParameters();
    $siteKey = strip_tags(trim($pC->get('recaptcha_sitekey', '')));
    $lang = strip_tags(trim($pC->get('recaptcha_lang', '')));
    if ($lang != '') {
        $lang = '?hl=' . $lang;
    }
    $document->addScript('https://www.google.com/recaptcha/api.js' . $lang);
    return '<div class="g-recaptcha" data-sitekey="' . $siteKey . '"></div>';
}