Code Monkey home page Code Monkey logo

yii2-social-share's Introduction

Stand With Ukraine

Extension for sharing on social networks

Build Status Scrutinizer Code Quality Total Downloads Monthly Downloads Latest Stable Version StandWithUkraine

With this extension you can share data from your web pages to any social network! Features: SEO support, default icons for social networks, easy creation of custom drivers for other social networks and more!

Documentation is at docs/guide/README.md.

Extension supports from the box next social network drivers:

drivers for messengers:

and other drivers:

also you can create your driver, it's very simple!

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require yiimaker/yii2-social-share

or add

"yiimaker/yii2-social-share": "~2.3"

to the require section of your composer.json.

Usage

Configure social networks in config file

    'components' => [
        // ...
        'socialShare' => [
            'class' => \ymaker\social\share\configurators\Configurator::class,
            'socialNetworks' => [
                'vkontakte' => [
                    'class' => \ymaker\social\share\drivers\Vkontakte::class,
                ],
                'facebook' => [
                    'class' => \ymaker\social\share\drivers\Facebook::class,
                ],
                'odnoklasniki' => [
                    'class' => \ymaker\social\share\drivers\Odnoklassniki::class,
                ],
            ],
        ],
    ],

and then call widget in view file

<?= \ymaker\social\share\widgets\SocialShare::widget([
    'configurator'  => 'socialShare',
    'url'           => \yii\helpers\Url::to('absolute/route/to/page', true),
    'title'         => 'Title of the page',
    'description'   => 'Description of the page...',
    'imageUrl'      => \yii\helpers\Url::to('absolute/route/to/image.png', true),
]); ?>

Tests

You can run tests with composer command

$ composer test

or using following command

$ ./vendor/bin/codecept build && ./vendor/bin/codecept run

Contributing

For information about contributing please read CONTRIBUTING.md.

Sponsoring

Buy Me A Coffee

License

License

This project is released under the terms of the BSD-3-Clause license.

Copyright (c) 2017-2019, Yii Maker

yii2-social-share's People

Contributors

greeflas avatar sokolnikov911 avatar wingee avatar bscheshirwork avatar dependabot-preview[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.