thyseus/yii2-banner

Banner advertisement manager for Yii2

Installs: 738

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:yii2-extension

dev-master 2018-12-20 13:03 UTC

This package is auto-updated.

Last update: 2024-04-21 01:33:36 UTC


README

Place advertisements banners on your Page.

  • Advertisements are valid from startdate to enddate
  • Multiple places where banners can appear
  • Active Banners are placed randomly
  • Uses slugs to identify banners over URL
  • Counts banner visits

Installation

$ composer require thyseus/yii2-banner
$ php yii migrate/up --migrationPath=@vendor/thyseus/yii2-banner/migrations

Configuration

Add following lines to your main configuration file:

'modules' => [
    'banner' => [
        'class' => 'thyseus\banner\Module',
        'allowedRoles' => ['admin', 'banner'], # which roles are allowed to administrate banners?
    ],
],

Place Banner:

Place this snippet inside your view where you want the corresponding adspace to appear:

<?php
    echo $this->render('@vendor/thyseus/yii2-banner/views/banner/_banner', ['adspace' => 'location_header_top']);
    echo $this->render('@vendor/thyseus/yii2-banner/views/banner/_banner', ['adspace' => 'location_header_right']);
    echo $this->render('@vendor/thyseus/yii2-banner/views/banner/_banner', ['adspace' => 'location_header_bottom']);

Actions

The following Actions are possible:

Contributing to this project

Anyone and everyone is welcome to contribute.

License

Yii2-banner is released under the GPLv3 License.