PHP code example of geertw / yii2-adsense

1. Go to this page and download the library: Download geertw/yii2-adsense library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geertw / yii2-adsense example snippets



return [
    'adsense' => [
        'client'  => 'ca-pub-1234567890123456',
        'slot'    => '1234567890',
        'enabled' => true,
    ],
];

<div style="width: 728px; height: 90px">
    <?= \geertw\Yii2\Adsense\AdsenseWidget::widget(); 

<div style="width: 728px; height: 90px">
    <?= \geertw\Yii2\Adsense\AdsenseWidget::widget(['slot' => '9012345678']);