original_string: public function render(ElementInterface $element)
      {
          $attributes = $element->getAttributes();
          $captcha = $element->getCaptcha();
  
          if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {
              throw new Exception\DomainException(sprintf(
                  '%s requires that the element has a "captcha" is an instance of LosReCaptcha\Captcha\ReCaptcha',
                  __METHOD__
              ));
          }
  
          $name          = $element->getName();
          $id            = isset($attributes['id']) ? $attributes['id'] : $name;
          $responseName  = empty($name) ? 'recaptcha_response_field' : $name . '[recaptcha_response_field]';
          $responseId    = $id . '-response';
  
          $markup = $captcha->getService()->getHtml($name);
          $hidden = $this->renderHiddenInput($responseName, $responseId);
          $js     = $this->renderJsEvents($responseId);
  
          return $hidden . $markup . $js;
      }
code: public function render(ElementInterface $element)
      {
          $attributes = $element->getAttributes();
          $captcha = $element->getCaptcha();
  
          if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {
              throw new Exception\DomainException(sprintf(
                  '%s requires that the element has a "captcha" is an instance of LosReCaptcha\Captcha\ReCaptcha',
                  __METHOD__
              ));
          }
  
          $name          = $element->getName();
          $id            = isset($attributes['id']) ? $attributes['id'] : $name;
          $responseName  = empty($name) ? 'recaptcha_response_field' : $name . '[recaptcha_response_field]';
          $responseId    = $id . '-response';
  
          $markup = $captcha->getService()->getHtml($name);
          $hidden = $this->renderHiddenInput($responseName, $responseId);
          $js     = $this->renderJsEvents($responseId);
  
          return $hidden . $markup . $js;
      }
code_tokens: public function render ( ElementInterface $ element ) { $ attributes = $ element -> getAttributes ( ) ; $ captcha = $ element -> getCaptcha ( ) ; if ( $ captcha === null || ! $ captcha instanceof CaptchaAdapter ) { throw new Exception \ DomainException ( sprintf ( '%s requires that the element has a "captcha" is an instance of LosReCaptcha\Captcha\ReCaptcha' , __METHOD__ ) ) ; } $ name = $ element -> getName ( ) ; $ id = isset ( $ attributes [ 'id' ] ) ? $ attributes [ 'id' ] : $ name ; $ responseName = empty ( $ name ) ? 'recaptcha_response_field' : $ name . '[recaptcha_response_field]' ; $ responseId = $ id . '-response' ; $ markup = $ captcha -> getService ( ) -> getHtml ( $ name ) ; $ hidden = $ this -> renderHiddenInput ( $ responseName , $ responseId ) ; $ js = $ this -> renderJsEvents ( $ responseId ) ; return $ hidden . $ markup . $ js ; }
docstring: Render ReCaptcha form elements
  
  @param  ElementInterface $element
  @throws Exception\DomainException
  @return string
docstring_tokens: Render ReCaptcha form elements