loadsys/cakephp_sociallinks

为模型添加字段以保存社交链接,例如博客、Facebook、Twitter等。

安装: 298

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 8

分支: 1

公开问题: 2

类型:cakephp-plugin

v1.0.1 2015-04-01 01:28 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:32:21 UTC


README

Latest Version Software License Build Status Coverage Status Total Downloads

为模型添加字段以保存社交链接,例如博客、Facebook、Twitter等。

要求

  • PHP 5.3+
  • CakePHP 2.1+

安装

Composer

$ composer require loadsys/cakephp_sociallinks:~1.0

使用方法

  • 通过在bootstrap.php中添加此行将SocialLinks添加到您的应用程序中
CakePlugin::load('SocialLinks');
  • 将行为添加到模型中,每个参数都是数据库字段名,或false以不包括该字段
public $actsAs = array(
	'SocialLinks.SocialLinks' => array(
		'blog' => 'blog', //blog field name in the database, or false if you don't have this field
		'pinterest' => false, //pinterest field name in the database, or false if you don't have this field
		'googleplus' => 'googleplus', //googleplus field name in the database, or false if you don't have this field
		'youtube' => 'youtube', //youtube field name in the database, or false if you don't have this field
		'linkedin' => 'linkedin', //linkedin field name in the database, or false if you don't have this field
		'facebook' => 'facebook', //facebook field name in the database, or false if you don't have this field
		'twitter' => 'twitter', //twitter field name in the database, or false if you don't have this field
	),
);

贡献

  • 将插件分支到您的Github账户
  • 检出插件
  • 创建一个新的分支以应用您的更改
  • 将更改的PR发回主分支

##许可证

版权所有(c)2015 Loadsys Web Strategies