octopouce-mu/advertising-bundle

Advertising bundle

dev-master 2019-08-23 11:48 UTC

This package is auto-updated.

Last update: 2024-03-23 22:02:19 UTC


README

Prerequisites

This version of the bundle requires Symfony Flex (>= 4.0) and PHP 7. You want to use Doctrine ORM and MySQL.

Installation

  1. Download OctopouceAdvertisingBundle using composer
  2. Follow installation OctopouceAdminBundle
  3. Update your database schema
  4. Import OctopouceAdminBundle routing
  5. Publish the Assets
  6. Configure your file security
  7. Usage : Add adzone in page

Step 1: Download OctopouceAdvertisingBundle using composer

Require the bundle with composer:

$ composer require octopouce-mu/advertising-bundle

Step 2: Follow installation OctopouceAdminBundle

For working the bundle, there needing OctopouceAdminBundle. Install dependencies bundles and configure.

OctopouceAdminBundle

Step 3: Update your database schema

For ORM run the following command.

$ php bin/console doctrine:schema:update --force

Caution

If error "1071 Specified key was too long; max key length is 767 bytes", you change configs doctrine :

# config/packages/doctrine.yaml
doctrine:
    dbal:
        charset: utf8
        default_table_options:
            charset: utf8
            collate: utf8_unicode_ci

Step 4: Import OctopouceAdvertisingBundle routing files

Now that you have activated and configured the bundle, all that is left to do is import the OctopouceAdvertisingBundle routing files if Symfony Flex hasn't already imported the file.

# config/routes/octopouce_advertising.yaml
_octopouce_advertising:
    resource: "@OctopouceAdvertisingBundle/Resources/config/routing/routing.yaml"

Step 5: Publish the Assets

$ php bin/console assets:install --symlink

Step 6: Configure your file security

# config/packages/security.yaml
security:
    role_hierarchy:
        ROLE_ADVERT: ROLE_USER
        ROLE_ADMIN: [ROLE_ADVERT]
        ROLE_SUPER_ADMIN: ROLE_ADMIN

Step 7: Usage - Add adzone in page

Array Twig Exemple :

{{ adzone("Exemple") }}

HTML Exemple :

{{ adzone("Exemple", true)|raw }}

Others bundles

You can to add bundles with OctopouceAdminBundle :