Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webchemistry/social-share
https://github.com/webchemistry/social-share
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/webchemistry/social-share
- Owner: WebChemistry
- Created: 2021-01-18T10:29:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-15T10:11:55.000Z (over 3 years ago)
- Last Synced: 2024-11-07T12:18:53.807Z (about 2 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Usage
### Standalone usage
```php
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
```yaml
extensions:
socialShare: WebChemistry\SocialShare\DI\SocialShareExtension
```### Nette configuration
```yaml
socialShare:
facebook: true # default
linkedIn: true # default
mail: true # default
messenger: true # default
pinterest: true # default
twitter: true # default
whatsApp: true # default
```### Nette inject
```php
use WebChemistry\SocialShare\SocialSharerInterface;
use WebChemistry\SocialShare\UrlToShare;class Service {
public function __construct(SocialSharerInterface $sharer) {
$sharer->share(new UrlToShare('https://example.com'));
}}
```