Answer the question
In order to leave comments, you need to log in
How to pass adsense code from php to angular or js?
Website on ZF2. Adsense codes are set in the admin panel, which are displayed in the template .
I see two ways: 1. We make a hidden block in the template where we display the code'code_value']
=$adsenseCodeMiddle[
<div id="adsense-code" style="display: none">
<?=$adsenseCodeMiddle['code_value']?>
</div>
var adsense_code = $('#adsense-code').html();
var adblock = [
'<div class="adblock">',
+ adsense_code +
'</div>'
].join("\n");
$('.account-item-last').after(adblock);
(adsbygoogle = window.adsbygoogle || []).push({});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question