Symfony bundle that is using SocialLinks to generate share links for social networks.

Installs: 47 022

Dependents: 0

Suggesters: 0

Security: 0

Stars: 11

Watchers: 19

Forks: 9


2.3.0 2017-10-02 05:31 UTC

This package is not auto-updated.

Last update: 2020-06-19 01:23:48 UTC


AstinaSocialLinksBundle is basically a wrapper around oscarotero/social-links. Its main purpose is to generate social links based on given provider.

Currently supported providers.


Step 1: Add to composer.json

"require" :  {
    // ...

Step 2: Enable the bundle

Enable the bundle in the kernel:

// app/AppKernel.php

public function registerBundles()
    $bundles = array(
        // ...
        new Astina\Bundle\SocialLinksBundle\AstinaSocialLinksBundle(),


Main functionality of this bundle is to generate a social link for given provider and url. It can be used as an twig extension, like in the example below.

Basic usage:

{{ social_link('facebook') }}

Extended usage:

{{ social_link('facebook', '', {'text': 'Custom text', attributes: {'class': 'custom-share', 'target': '_self'} }, 'Custom link text') }}

This example will return an HTML response which looks like.

<a href=";" class="custom-share" target="_self"></a>

Helper accepts three parameters - provider as string, url as string, options as multidimensional array and link text as string. There you can basically add as many custom attributes as you want.

Options and default values:

'title'   => null
'text'    => null
'options' => array('attributes' => array('target' => '_blank'))
'linkText => null

Template extending

It is also possible to extend a social link template, by simply adding a socialLink.html.twig template in app/Resources/AstinaSocialLinksBundle/views/SocialLinks.

Run tests