https://github.com/idmarinas/advertising-bundle
Show network ads in your Symfony App. Come with the Adsense Network and Generic network for add your own network.
https://github.com/idmarinas/advertising-bundle
advertising bundle symfony-bundle symfony4 symfony5 symfony6
Last synced: 2 months ago
JSON representation
Show network ads in your Symfony App. Come with the Adsense Network and Generic network for add your own network.
- Host: GitHub
- URL: https://github.com/idmarinas/advertising-bundle
- Owner: idmarinas
- License: bsd-3-clause
- Created: 2021-02-13T16:01:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-29T19:05:23.000Z (7 months ago)
- Last Synced: 2024-11-29T20:19:15.502Z (7 months ago)
- Topics: advertising, bundle, symfony-bundle, symfony4, symfony5, symfony6
- Language: PHP
- Homepage:
- Size: 105 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/idmarinas/advertising-bundle/actions/workflows/php.yml)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)


[](http://php.net/)




[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)
[](https://sonarcloud.io/dashboard?id=idmarinas_advertising-bundle)[](https://www.paypal.me/idmarinas)
[](https://liberapay.com/IDMarinas/donate)
[](https://twitter.com/idmarinas)# AdvertisingBundle
Show network ads in your Symfony App. Come with the Adsense Network and Generic network for add your own network.## Installation ##
### Composer ###
```bash
composer require idmarinas/advertising-bundle
```## Usage ##
Configuration reference:
```yaml
# config/packages/idm_advertising.yamlidm_advertising:
enable: true # Enable/disable advertising bundle. default false
networks: # Required
adsense: # Default configuration for AdSense Advertising
type: adsense
# service_network: idm_advertising.adsense # Custom service provider, ID of service
enable: true # Enable/disable advertising provider
client: null # "data-ad-client" ca-pub-XXXXXXX11XXX9
banners: # Banners of ads (As many as you need with the same format). Required
banner_header:
style: 'display:block' # style="" tag in
slot: 0 # "data-ad-slot" Slot ID of Ad block 8XXXXX1
format: 'auto' # "data-ad-format" Values: "rectangle", "vertical" or "horizontal"
responsive: true # "data-full-width-responsive"
other_banner:
style: 'display:block'
slot: 0
format: 'auto'
responsive: true
generic:
type: generic # Required
service_network: 'your.service.id' # Required
banners: # Required
custom_zone:
config: 'for your custom network banner'
```Usage in your templates:
```twig
{{ advertising_banner('adsense', 'banner_header') }}
{{ advertising_banner('generic', 'custom_zone') }}
```
The First argument is the network name, and the second argument is the name of banner.
For last need print scripts for your banners:
```twig
{{ advertising_scripts() }}
{{ advertising_scripts('adsense') }}
```