dxw/iguana-share

v1.2.0 2023-08-16 08:55 UTC

This package is auto-updated.

Last update: 2024-05-05 03:55:59 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.