elephpant/social-share

A simple way to generate social share links.

2.0.1 2023-09-25 15:06 UTC

This package is auto-updated.

Last update: 2024-11-25 18:00:26 UTC


README

Maintainer Source Code PHP from Packagist Latest Version Software License Build Quality Score Total Downloads

A simple way to generate social share links.

Um jeito simples de gerar links de compartilhamento social.

Highlights

  • Simple installation (Instalação simples)
  • Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)

Available services

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • WhatsApp
  • Telegram
  • Reddit
  • Email

Installation

SocialShare is available via Composer:

"elephpant/social-share": "2.0.*"

or run

composer require elephpant/social-share

Documentation

For details on how to use, see a sample folder in the component directory. In it you will have an example of using the class. It works like this:

Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do componente. Nela terá um exemplo de uso da classe. Ele funciona assim:

Basic Usage:
<?php
require __DIR__ . '/../vendor/autoload.php';

use ElePHPant\SocialShare\SocialShare;

// [required] $url, [required] $text
$share = new SocialShare('https://github.com', 'Build software better, together');
?>

<ul>
    <li><a href="<?= $share::facebook(); ?>" target="_blank">Facebook</a></li>
    <li><a href="<?= $share::twitter(/* $username */); ?>" target="_blank">Twitter</a></li>
    <li><a href="<?= $share::linkedin(/* $summary, $source */); ?>" target="_blank">LinkedIn</a></li>
    <li><a href="<?= $share::pinterest(/* $image */); ?>" target="_blank">Pinterest</a></li>
    <li><a href="<?= $share::whatsapp(); ?>" target="_blank">WhatsApp</a></li>
    <li><a href="<?= $share::telegram(); ?>" target="_blank">Telegram</a></li>
    <li><a href="<?= $share::reddit(); ?>" target="_blank">Reddit</a></li>
    <li><a href="<?= $share::email(/* $recipientEmail */); ?>" target="_blank">Email</a></li>
</ul>

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.