Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dfp Bundle Laravel Package

dbtlr/dfp-bundle

View on GitHub
Deep Wiki
Context7

Google DFP Bundle for Symfony2 Travis-CI Build Status

Installation Instructions

  1. Download NodrewDfpBundle
  2. Configure the Autoloader
  3. Enable the Bundle
  4. Add your Google DFP Publisher Id

Step 1: Download NodrewDfpBundle

Ultimately, the NodrewDfpBundle files should be downloaded to the vendor/bundles/Nodrew/Bundle/DfpBundle directory.

This can be done in several ways, depending on your preference. The first method is the standard Symfony2 method.

Using the vendors script

Add the following lines in your deps file:

[NodrewDfpBundle]
    git=http://github.com/nodrew/NodrewDfpBundle.git
    target=/bundles/Nodrew/Bundle/DfpBundle

Now, run the vendors script to download the bundle:

$ php bin/vendors install

Using submodules

If you prefer instead to use git submodules, then run the following:

$ git submodule add http://github.com/nodrew/NodrewDfpBundle.git vendor/bundles/Nodrew/Bundle/DfpBundle
$ git submodule update --init

Step 2: Configure the Autoloader

// app/autoload.php

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
    // ...
    'Nodrew'   => __DIR__.'/../vendor/bundles',
));

Step 3: Enable the bundle

Finally, enable the bundle in the kernel:

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Nodrew\Bundle\DfpBundle\NodrewDfpBundle(),
    );
}

Step 4: Add your Google DFP Publisher Id

# app/config/config.yml
nodrew_dfp:
    publisher_id:   [publisher_id]

Step 5: Add Control Code Placeholder to layout

This placeholder comment needs to be added to the head of your layout. It is automatically replaced with the proper Google DFP code, when ads are used on the given page.

// app/views/base.html.twig
<head>
    ...
    <!-- NodrewDfpBundle Control Code -->
</head>

Using Ad Units

In page unit.

To use a standard in page ad unit, add the following to your template:

{{ dfp_ad_unit('some/campaign', [300, 250]) }}

The appropriate control codes will be added to the header, if everything was done correctly during setup.

Out of page unit.

If you're looking to do a DFP out of page unit, such as an interstitial, or a skin, then use this code. It is much similar, just without the size attached to it.

{{ dfp_oop_ad_unit('some/campaign') }}

The appropriate control codes will be added to the header, if everything was done correctly during setup.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope