public function scriptWithCallback(array $captchas, $callbackName = 'captchaRenderCallback')
    {
        $script = $this->script($callbackName);

        if (empty($script) || empty($captchas)) {
            return $script;
        }

        return implode(PHP_EOL, [implode(PHP_EOL, [
            '<script>',
                "
                var ".implode(',', $captchas).";
                var $callbackName = function() {",
                    $this->renderCaptchas($captchas),
                '};',
            '</script>'
        ]), $script]);
    }
public function scriptWithCallback(array $captchas, $callbackName = 'captchaRenderCallback')
    {
        $script = $this->script($callbackName);

        if (empty($script) || empty($captchas)) {
            return $script;
        }

        return implode(PHP_EOL, [implode(PHP_EOL, [
            '<script>',
                "
                var ".implode(',', $captchas).";
                var $callbackName = function() {",
                    $this->renderCaptchas($captchas),
                '};',
            '</script>'
        ]), $script]);
    }
public function scriptWithCallback ( array $ captchas , $ callbackName = 'captchaRenderCallback' ) { $ script = $ this -> script ( $ callbackName ) ; if ( empty ( $ script ) || empty ( $ captchas ) ) { return $ script ; } return implode ( PHP_EOL , [ implode ( PHP_EOL , [ '<script>' , "
                var " . implode ( ',' , $ captchas ) . ";
                var $callbackName = function() {" , $ this -> renderCaptchas ( $ captchas ) , '};' , '</script>' ] ) , $ script ] ) ; }
Get script tag with a callback function.

@param  array   $captchas
@param  string  $callbackName

@return string
Get script tag with a callback function .