loadsys / cakephp_sociallinks
为模型添加字段以保存社交链接,例如博客、Facebook、Twitter等。
v1.0.1
2015-04-01 01:28 UTC
Requires
- php: >=5.3.0
- composer/installers: ~1.0
This package is not auto-updated.
Last update: 2024-09-14 15:32:21 UTC
README
为模型添加字段以保存社交链接,例如博客、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