oefenweb/cakephp-social-media

A minimalistic SocialMedia Plugin for CakePHP

Installs: 25 854

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 3

Forks: 4

Open Issues: 1

Type:cakephp-plugin

v3.0.1 2018-01-19 20:17 UTC

This package is auto-updated.

Last update: 2024-11-24 04:11:17 UTC


README

Build Status PHP 7 ready Coverage Status Packagist downloads Code Climate Scrutinizer Code Quality

The SocialMedia plugin provides the tools to generate social media links (Helper) and handle them (Controller).

Requirements

  • CakePHP 2.9.0 or greater.
  • PHP 7.0.0 or greater.

Installation

  • Clone/Copy the files in this directory into app/Plugin/SocialMedia

Configuration

  • Ensure the plugin is loaded in app/Config/bootstrap.php by calling:
CakePlugin::load('SocialMedia');
  • Ensure to configure the following two lines in app/Config/bootstrap.php:
Configure::write('SocialMedia.salt', 'your-salt');
Configure::write('SocialMedia.facebookAppId', 'your-facebook-app-id');

Usage

Facebook share link

echo $this->SocialMedia->facebook(
	__('Share on Facebook'), [
		'link' => 'your-url',
		'name' => 'your-name',
		'caption' => 'your-caption',
		'description' => 'your-description',
		'picture' => 'your-picture'
	]
);

Twitter tweet link

echo $this->SocialMedia->twitter(
	__('Tweet on Twitter'), [
		'url' => 'your-url',
		'via' => 'your-via',
		'text' => 'your-text',
	]
);