simseo/forum-bundle

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Forum for Symfony, Can be used with SonataAdminBundle

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 2

Open Issues: 2

Type:symfony-bundle

dev-master 2017-07-11 06:25 UTC

This package is not auto-updated.

Last update: 2021-11-27 12:42:15 UTC


README

Ce bundle est actuellement en developpement. Pour ceux qui voudraient contribuer, merci de faire une pull request sur Github.

Installation

Ce bundle a besoin d'utiliser knplabs/knp-paginator-bundle, stof/doctrine-extensions-bundle et egeloen/ckeditor-bundle. Je vous renvoie à leur propre documentation pour leur installation.

Utilisez composer pour gérer les dépendances et télécharger SimseoForumBundle

    $ php composer.phar require simseo/forum-bundle

Enregistrez le bundle dans app/AppKernel.php

    <?php
    // app/AppKernel.php
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Simseo\ForumBundle\SimseoForumBundle(),
        );
        // ...
    }

Ajoutez les routes:

    # app/config/routing.yml

    simseo_forum:
    resource: "@SimseoForumBundle/Resources/config/routing.yml"
    prefix:   /forum

Ajoutez la configuration suivante dans app/config/config.yml

    # app/config/config.yml
    
    simseo_forum:
        antiflood:
            enabled: true
            hours: 12 
        preview:
            enabled: true
        pagination:
            page_name: page
            topics:
                enabled: true
                per_page: 5
            posts: 
                enabled: true
                per_page: 5
        sonata_admin:
            enabled: false # passez cette option à true si vous utilisez SonataAdminBundle

Ajoutez un ROLE_MODERATOR dans app/config/security.yml

    # app/config/security.yml

    security:
        role_hierarchy:
            ROLE_ADMIN:       [ROLE_MODERATOR]
            ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
            ROLE_MODERATOR:   [ROLE_USER]

Configuration

    # app/config/config.yml

    doctrine:
        orm:
            auto_generate_proxy_classes: '%kernel.debug%'
            naming_strategy: doctrine.orm.naming_strategy.underscore
            auto_mapping: true
            resolve_target_entities:
                Symfony\Component\Security\Core\User\UserInterface: Namespace\YourUserBundle\Entity\User
                Sonata\MediaBundle\Model\MediaInterface: NameSpace\YourMediaBundle\Entity\Media

    # StofDoctrineExtentions Configuration
    stof_doctrine_extensions:
        orm:
            default:
                sluggable: true
                timestampable: true
                blameable: true
                sortable: true

    knp_paginator:
        page_range: 5
        default_options:
            page_name: page
            sort_field_name: sort
            sort_direction_name: direction
            distinct: true
        template:
            pagination: 'KnpPaginatorBundle:Pagination:sliding.html.twig'
            sortable: 'KnpPaginatorBundle:Pagination:sortable_link.html.twig'

    simseo_forum:
        antiflood:
            enabled: true
            hours: 12
        preview:
            enabled: true
        pagination:
            page_name: page
            topics:
                enabled: true
                per_page: 5
            posts: 
                enabled: true
                per_page: 5
        sonata_admin:
            enabled: false

Mettez à jour la base de donnée

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

Rendez vous ensuite à l'adresse /forum/admin et créez vos premiers forums.