nycooookie / social-share
Generate share links for various social services
dev-master
2018-11-19 20:29 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2025-08-20 11:17:12 UTC
README
This "library" helps you generate share links for various (well at the moment rather limited) social services.
$s = new SocialShare('Google', 'https://google.com', 'This is Google');
$s->twitter(); // "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgoogle.com"
$s->facebook(); // "https://twitter.com/intent/tweet?text=Google&url=https%3A%2F%2Fgoogle.com"
$s->xing(); // "https://www.xing.com/spi/shares/new?url=https%3A%2F%2Fgoogle.com"
$s->linkedin(); // "https://www.linkedin.com/shareArticle?url=https%3A%2F%2Fgoogle.com&summary=This+is+Google"
$s->mail(); // "mailto:?subject=Google&body=This%20is%20Google%3A%20https%3A%2F%2Fgoogle.com"
$s->all(); // All of the above in an array