定制 drmonkeyninja/social-share-url 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drmonkeyninja/social-share-url

最新稳定版本:1.5.0

Composer 安装命令:

composer require drmonkeyninja/social-share-url

包简介

A standalone utility library for generating URLs to share content on numerous social media platforms.

关键字:

README 文档

README

Build Status Latest Stable Version

A standalone utility library for generating URLs to share content on numerous social media platforms.

Social Share currently supports Bluesky, Delicious, Digg, Evernote, Facebook, Friend Feed, Google Bookmarks, Hacker News, LinkedIn, Newsvine, Pinterest, Pocket, Reddit, Slashdot, simple email, StumbleUpon, Technorati, Tumblr, Twitter/X, VK, WhatsApp and Xing.

Requirements

  • Composer

Installation

Install via Composer:-

composer require drmonkeyninja/social-share-url ~1

Usage

To generate a social share URL simply use the getUrl() method passing it the name of the social network you want to link to and the URL of the page you want to share:-

use \drmonkeyninja\SocialShareUrl\SocialShareUrl;

$SocialShareUrl = new SocialShareUrl();
$url = $SocialShareUrl->getUrl('facebook', 'http://example.com');

You can pass further parameters to be included in the share URL by passing them as an array to the third parameter:-

$url = $SocialShareUrl->getUrl(
	'facebook',
	'http://example.com'
	['text' => 'Hello World']
);

Supported parameters include:-

  • text
  • image

A full list of the available social networks can be found in the src/data/stubs.php file. You can also return a full list of the social networks supported by SocialShareUrl by using the getServices() method:-

$services = $SocialShareUrl->getServices();

License

The MIT License.

统计信息

  • 总下载量: 5.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-29