dxw / iguana-share
v1.2.0
2023-08-16 08:55 UTC
Requires
- php: ^7.4||^8.1
- dxw/iguana: ^1.0
Requires (Dev)
- dxw/iguana-theme: ^1.1
- dxw/php-cs-fixer-config: ^2.1
- kahlan/kahlan: ^5.2
This package is auto-updated.
Last update: 2024-12-05 05:08:19 UTC
README
This package provides a reusable way to output simple, accessible lists of social sharing buttons which can be styled according to your need.
Available buttons: Facebook, Google Plus, LinkedIn and Twitter.
How to use
Install the package: composer require dxw/iguana-share
. You will also need Iguana Theme Helpers installed.
Register the Share Buttons class in your app/di.php
Iguana file, passing in an instance of the Iguana Helper class, and the classes for the buttons you require. e.g.
$registrar->addInstance(new \Dxw\Iguana\Theme\Helpers()); $registrar->addInstance(\Dxw\Iguana\Share\ShareButtons( $registrar->getInstance(\Dxw\Iguana\Theme\Helpers::class, [ new Dxw\Iguana\Share\FacebookShareLink(); new Dxw\Iguana\Share\LinkedInShareLink(); new Dxw\Iguana\Share\TwitterShareLink(); ] ) ))
Then call h()->shareButtons()
in your template file to output the share buttons HTML.