PHP code example of snapshotpl / zf-snap-google-adsense

1. Go to this page and download the library: Download snapshotpl/zf-snap-google-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/ */

    

snapshotpl / zf-snap-google-adsense example snippets


return array(
  'zf-snap-google-adsense' => array(
    'publisher-id' => 'pub-1234567890123456',
    'ads' => array(
      'home-page' => array(
        'id' => 1234567890,
        'size' => '336x280',
      ),
    ),
  ),
);

echo $this->adsense('home-page');

return array(
  'view_manager' => array(
    'template_map' => array(
      'zf-snap-google-adsense-renderer-view-customview' => __DIR__ . '/my-awesome-custom-view.phtml',
    ),
  ),
);

return array(
  'zf-snap-google-adsense' => array(
    'renderer' => 'zf-snap-google-adsense-renderer-view-customview',
  ),
);

return array(
  'zf-snap-google-adsense' => array(
    'ads' => array(
      'link-ad-by-constat' => array(
        'id' => 1234567890,
        'size' => '336x280',
        'type' => \ZfSnapGoogleAdSense\Model\AdUnit::TYPE_LINK,
      ),
      'link-ad-by-string' => array(
        'id' => 1234567890,
        'size' => array(
          'width' => 336,
          'height' => 280,
        ),
        'type' => 'link',
      ),
      'content-ad' => array(
        'id' => 1234567890,
        'size' => '336x280',
        'type' => \ZfSnapGoogleAdSense\Model\AdUnit::TYPE_CONTENT,
        'name' => 'Content ad under header',
      ),
    ),
  ),
);

return array(
  'zf-snap-google-adsense' => array(
    'enable' => false,
  ),
);

return array(
  'zf-snap-google-adsense' => array(
    'unit-limit' => array(
      AdUnit::TYPE_CONTENT => 3,
      AdUnit::TYPE_LINK => 3,
    ),
  ),
);