cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Phalcon V4.1+ Asset Collection Inline Js not producing the output as expected ?

Open mahen3d opened this issue 2 years ago • 0 comments

Discussed in https://github.com/phalcon/cphalcon/discussions/16303

Originally posted by mahen3d March 3, 2023 when I do this code as below

$this->assets->collection('facebook')
            ->setPrefix('https://connect.facebook.net/%27)
            ->addJs('/en_US/sdk.js#xfbml=1&version=v16.0&appId=426089538585786&autoLogAppEvents=1',
                    false,
                    false,
                    ['async' => true, 'defer' => true, 'nonce' => "29n16Pxp", 'crossorigin' => 'anonymous']
            );

I get the following output which is not exactly what I wanted

<script src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v16.0&amp;appId=426089538585786&amp;autoLogAppEvents=1" async="1" defer="1" nonce="29n16Pxp" crossorigin="anonymous"></script>

What I wanted is the following output what's wrong here?

<script src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0&appId=426089538585786&autoLogAppEvents=1" async defer nonce="29n16Pxp" crossorigin="anonymous"></script>

mahen3d avatar Mar 03 '23 03:03 mahen3d