n3o77 / ShariffBundle

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is ShariffBundle?

Latest Stable Version Latest Unstable Version License

Build Status Scrutinizer Code Quality 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

Add the block to the sonata_block configuration if necessary:

sonata_block:
    blocks:
        ...
        core23_shariff.block.share: ~

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

This bundle is available under the MIT license.

About

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

License:MIT License


Languages

Language:PHP 93.2%Language:HTML 3.7%Language:Makefile 3.0%