core23/shariff-bundle

This bundle provides a wrapper for using shariff inside the sonata-project.

2.0.0 2017-09-14 07:39 UTC

README

Latest Stable Version Latest Unstable Version License

Build Status Scrutinizer Code Quality Code Climate Coverage Status SensioLabsInsight

Donate to this project using Flattr Donate to this project using PayPal

This bundle provides a wrapper for using shariff inside the symfony sonata-project.

Installation

php composer.phar require core23/shariff-bundle

Enabling the bundle

    // app/AppKernel.php

    public function registerBundles()
    {
        return array(
            // ...

            new Core23\ShariffBundle\Core23ShariffBundle(),

            // ...
        );
    }
# app/config/routing.yml

core23_shariff:
    resource: "@Core23ShariffBundle/Resources/config/routing/backend.yml"

Usage

{# template.twig #}

{{ sonata_block_render({ 'type': 'core23.shariff.block.share' }, {
    'url': 'https://example.com/site.html'
}) }}

Configuration

You can globally configure the services that should count the likes or favorites for a page.

doctrine_cache:
    providers:
        core23_shariff:
            type: php_file
            namespace: core23_shariff


core23_shariff:
    options:
        domains: [ ] # Allow specific domains for shariff
        services: [ 'GooglePlus', 'Facebook', 'LinkedIn', 'Reddit', 'StumbleUpon', 'Flattr', 'Pinterest', 'Xing', 'AddThis' ]
    services:
        # Optional configuration when using facebook service
        facebook:
            app_id: 1234567890
            secret: GENERATEDSECRET

See shariff-php for a list of all available services.

This bundle is available under the MIT license.