webchemistry / social-share
Installs: 2 786
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >= 7.4
This package is auto-updated.
Last update: 2024-12-15 17:05:14 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')); } }