An open API service indexing awesome lists of open source software.

https://github.com/thyseus/yii2-banner


https://github.com/thyseus/yii2-banner

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# ATTENTION:

github has been bought by Microsoft. This repository is orphaned and has been moved to:

https://gitlab.com/thyseus/yii2-banner

Thanks a lot for your understanding and blame Microsoft.

# Yii2-banner

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

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

## Configuration

Add following lines to your main configuration file:

```php
'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
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:

* admin: https://your-domain/banner/banner/admin
* create: https://your-domain/banner/banner/create
* visit: https://your-domain/banner/banner/visit/
* view: https://your-domain/banner/banner/view/
* update: https://your-domain/banner/banner/update/
* delete: https://your-domain/banner/banner/delete/

## Contributing to this project

Anyone and everyone is welcome to contribute.

## License

Yii2-banner is released under the GPLv3 License.