nycooookie / social-share
为各种社交服务生成分享链接
dev-master
2018-11-19 20:29 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-09-20 09:11:55 UTC
README
这个“库”可以帮助你为各种(目前相对有限的)社交服务生成分享链接。
$s = new SocialShare('Google', 'https://google.com', 'This is Google');
$s->twitter(); // "https://#/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