oefenweb / cakephp-social-media
A minimalistic SocialMedia Plugin for CakePHP
Installs: 27 131
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 4
Open Issues: 1
Type:cakephp-plugin
pkg:composer/oefenweb/cakephp-social-media
Requires
- php: >=7.0.0
 - composer/installers: ~1.0
 
Requires (Dev)
- oefenweb/cakephp-codesniffer: ^3.0.0
 - phpmd/phpmd: ^2.6
 - phpunit/phpunit: ^5.7|^6.0
 - sebastian/phpcpd: ^3.0
 
README
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.phpby 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',
	]
);