webchemistry/social-share

There is no license information available for the latest version (v1.1.0) of this package.

v1.1.0 2021-09-15 10:11 UTC

This package is auto-updated.

Last update: 2024-04-15 15:39:13 UTC


README

Standalone usage

use WebChemistry\SocialShare\Provider\FacebookProvider;
use WebChemistry\SocialShare\Provider\LinkedInProvider;
use WebChemistry\SocialShare\SocialSharer;use WebChemistry\SocialShare\UrlToShare;

$sharer = new SocialSharer([
	new FacebookProvider(),
	new LinkedInProvider(),
]);

$sharer->share(new UrlToShare('https://example.com'));

Nette

extensions:
	socialShare: WebChemistry\SocialShare\DI\SocialShareExtension

Nette configuration

socialShare:
	facebook: true # default
	linkedIn: true # default
	mail: true # default
	messenger: true # default
	pinterest: true # default
	twitter: true # default
	whatsApp: true # default

Nette inject

use WebChemistry\SocialShare\SocialSharerInterface;
use WebChemistry\SocialShare\UrlToShare;

class Service {

	public function __construct(SocialSharerInterface $sharer) {
		$sharer->share(new UrlToShare('https://example.com'));
	}

}