PHP Classes

How to Get More Visibility to Web Site Pages Using the PHP Social Network Package Yii2 Sharelinks Widget: Generate links to share pages in social networks

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-07-26 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 14 All time: 11,356 This week: 59Up
Version License PHP version Categories
yii2-sharelinks-widg 1.0BSD License5HTML, PHP 5, Social Networking
Description 

Authors

Carlos C. Caballero Diaz
Gabriel A. López López


Contributor

This package can generate links to share pages on social networks.

It provides a class that takes a URL of a page to share and generates HTML links pointing to social network pages to share the page with the given URL.

Currently it supports the social networks:

- Twitter

- Facebook

- VKontakte

- GPlus

- LinkedIn

- Kindle

- Xing

Picture of Gabriel Alejandro López López
  Performance   Level  
Name: Gabriel Alejandro López ... <contact>
Classes: 10 packages by
Country: United States United States
Age: 35
All time rank: 4338551 in United States United States
Week rank: 199 Up28 in United States United States Up
Innovation award
Innovation award
Nominee: 3x

Documentation

yii2-sharelinks-widget

Yii2 widget for popular social networks "share link" generation. Based on https://github.com/ijackua/yii2-sharelinks-widget.

Supported Social Networks

Installation via Composer

add to require section of your composer.json "daxslab/yii2-sharelinks-widget": "*" and run composer update

Usage Example

in template file use

<?php echo \daxslab\sharelinks\ShareLinks::widget(
	[
		'viewName' => '@app/views/mypath/shareLinks.php'   //custom view file for you links appearance
	]
); ?>

Example custom view file

This eaxmple uses custom icons from Fontello, but you can make it what ever you want and customize what links do you need and what not. Your @app/views/mypath/shareLinks.php file could look like

<?php
use daxslab\sharelinks\ShareLinks;
use \yii\helpers\Html;

/
 * @var yii\base\View $this
 */

?>

<div class="socialShareBlock">
	<?=
	Html::a('<i class="icon-facebook-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_FACEBOOK),
		['title' => 'Share to Facebook']) ?>
	<?=
	Html::a('<i class="icon-twitter-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_TWITTER),
		['title' => 'Share to Twitter']) ?>
	<?=
	Html::a('<i class="icon-linkedin-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_LINKEDIN),
		['title' => 'Share to LinkedIn']) ?>
	<?=
	Html::a('<i class="icon-gplus-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_GPLUS),
		['title' => 'Share to Google Plus']) ?>
	<?=
	Html::a('<i class="icon-vkontakte"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_VKONTAKTE),
		['title' => 'Share to Vkontakte']) ?>
	<?=
	Html::a('<i class="icon-tablet"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_KINDLE),
		['title' => 'Send to Kindle']) ?>
</div>

  Files folder image Files (7)  
File Role Description
Files folder imageassets (1 file)
Files folder imageviews (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me
Plain text file ShareLinks.php Class Class source
Plain text file ShareLinksAssets.php Class Class source

  Files folder image Files (7)  /  assets  
File Role Description
  Accessible without login Plain text file social.js Data Auxiliary data

  Files folder image Files (7)  /  views  
File Role Description
  Accessible without login Plain text file main.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:14
This week:0
All time:11,356
This week:59Up