public function display($attributes = [], $options = [])
    {
        $isMultiple = (bool)$this->options->get('multiple', $options);
        if (!array_key_exists('id', $attributes)) {
            $attributes['id'] = $this->randomCaptchaId();
        }
        $html = '';
        if (!$isMultiple && array_get($attributes, 'add-js', true)) {
            $html .= '<script src="' . $this->getJsLink($options) . '" async defer></script>';
        }
        unset($attributes['add-js']);
        $attributeOptions = $this->options->get('attributes', $options);
        if (!empty($attributeOptions)) {
            $attributes = array_merge($attributeOptions, $attributes);
        }
        if ($isMultiple) {
            array_push($this->captchaAttributes, $attributes);
        } else {
            $attributes['data-sitekey'] = $this->config->get('captcha.sitekey');
        }

        return $html . '<div class="g-recaptcha"' . $this->buildAttributes($attributes) . '></div>';
    }
public function display($attributes = [], $options = [])
    {
        $isMultiple = (bool)$this->options->get('multiple', $options);
        if (!array_key_exists('id', $attributes)) {
            $attributes['id'] = $this->randomCaptchaId();
        }
        $html = '';
        if (!$isMultiple && array_get($attributes, 'add-js', true)) {
            $html .= '<script src="' . $this->getJsLink($options) . '" async defer></script>';
        }
        unset($attributes['add-js']);
        $attributeOptions = $this->options->get('attributes', $options);
        if (!empty($attributeOptions)) {
            $attributes = array_merge($attributeOptions, $attributes);
        }
        if ($isMultiple) {
            array_push($this->captchaAttributes, $attributes);
        } else {
            $attributes['data-sitekey'] = $this->config->get('captcha.sitekey');
        }

        return $html . '<div class="g-recaptcha"' . $this->buildAttributes($attributes) . '></div>';
    }
public function display ( $ attributes = [ ] , $ options = [ ] ) { $ isMultiple = ( bool ) $ this -> options -> get ( 'multiple' , $ options ) ; if ( ! array_key_exists ( 'id' , $ attributes ) ) { $ attributes [ 'id' ] = $ this -> randomCaptchaId ( ) ; } $ html = '' ; if ( ! $ isMultiple && array_get ( $ attributes , 'add-js' , true ) ) { $ html .= '<script src="' . $ this -> getJsLink ( $ options ) . '" async defer></script>' ; } unset ( $ attributes [ 'add-js' ] ) ; $ attributeOptions = $ this -> options -> get ( 'attributes' , $ options ) ; if ( ! empty ( $ attributeOptions ) ) { $ attributes = array_merge ( $ attributeOptions , $ attributes ) ; } if ( $ isMultiple ) { array_push ( $ this -> captchaAttributes , $ attributes ) ; } else { $ attributes [ 'data-sitekey' ] = $ this -> config -> get ( 'captcha.sitekey' ) ; } return $ html . '<div class="g-recaptcha"' . $ this -> buildAttributes ( $ attributes ) . '></div>' ; }
Create captcha html element

@param array $attributes
@param array $options
@return string
Create captcha html element