ryannielson/shareable 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ryannielson/shareable

Composer 安装命令:

composer require ryannielson/shareable

包简介

A Laravel 4 package to make it easy to add social sharing buttons to your application.

README 文档

README

#shareable

A Laravel 4 package to make it easy to add social sharing buttons to your application.

This Laravel 4 package provides helpers for easily adding social sharing buttons to your views. This package includes support for:

  • Facebook
  • Google Plus
  • Twitter

Installation

Run the following Composer command in your terminal, or simply add 'ryannielson/shareable': '1.0.*' to your composer.json file:

composer require ryannielson/shareable:'1.0.*'

Once complete, you now have to add the the service provider to the providers array in app/config/app.php:

'RyanNielson\Shareable\ShareableServiceProvider'

Finally, add the following entry entry to the aliases array in app/config/app.php:

'Shareable' => 'RyanNielson\Shareable\Facades\Shareable'

That's it!

Usage

Shareable current supports only a few social networks, which are accessed through a similar Shareable facade which should be used in your views. Each of these methods can also be passed an array of options which correspond to the options shown on the respective button creation pages and listed below.

Render all share buttons, specified in the config.php (default all buttons), within a unordered list:

{{ Shareable::all() }}

Facebook

developers.facebook.com/docs/plugins/share-button

{{ Shareable::facebook($options = array()) }}
Option Type Default Possible Options
url string ''
width integer 100
type string 'button_count' 'box_count', 'button_count', 'button', 'icon_link', 'icon', 'link'

Google Plus

developers.google.com/+/web/share

{{ Shareable::googlePlus($options = array()) }}
Option Type Default Possible Options
url string ''
size string 'medium' 'small', 'medium', 'large'
lang string 'en-US' See developers.google.com/+/web/share/
width integer null
annotation string 'bubble' 'none', 'bubble', vertical-bubble', 'inline'

Twitter

about.twitter.com/resources/buttons#tweet

{{ Shareable::twitter($options = array()) }}
Option Type Default Possible Options
url string ''
text string ''
count boolean true
via string ''
recommend string ''
hashtags string ''
size string ''
lang string 'en'

View and Configuration Changes

Like most Laravel packages, you can edit the configuration and views for this package by running a few commands to put the files into your app's project directory.

Edit configuration: php artisan config:publish ryannielson/shareable

Edit views: php artisan view:publish ryannielson/shareable

统计信息

  • 总下载量: 2.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 4
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固