rogersxd / vcard
快速生成vCards。
1.0.2
2018-07-16 14:51 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2024-09-18 05:10:47 UTC
README
VCard PHP库。仅支持VCF文件。
用法
安装
composer require rogersxd/vcard
这将使用Composer安装vcard的最新版本
示例
use Rogersxd\VCard\VCard; $vcard = new VCard(); $vcard->addPhoto(__DIR__ .'/images/rogerscorrea.jpg'); $lastName = 'Corrêa'; $firstName = 'Rogers'; $additional = ''; $prefix = ''; $suffix = ''; $fullName = true; $vcard->addnames( $lastName, $firstName, $additional, $prefix, $suffix, $fullName ); $vcard->addPhone('+5551999999999', 'CELL'); $vcard->addPhone('+555133333333', 'HOME'); $vcard->addJobtitle('Banking'); $vcard->addRole('Developer'); $vcard->addEmail('rogersgbc@gmail.com'); $vcard->addCompany('XYZ'); $vcard->addUrl('http://rogerscorrea.wordpress.com'); $vcard->addUrl('https://github.com/rogersxd'); $vcard->addNote('CUSTOM-NOTE: TEST VCARD'); $vcard->addBirthday('YYYY-MM-DD'); $name = ''; $extended = ''; $street = 'Francisco Martins, 123'; $city = 'Porto Alegre'; $region = 'RS'; $zip = '91712-150'; $country = 'BR'; $type = 'HOME'; $vcard->addAddress( $name, $extended, $street, $city, $region, $zip, $country, $type ); $socialProfile1 = 'https://facebook.com/'; $typeSocialProfile1 = 'facebook'; $socialProfile2 = 'https://instagram.com/'; $typeSocialProfile2 = 'instagram'; $socialProfile3 = 'https://twitter.com/'; $typeSocialProfile3 = 'twitter'; $socialProfile4 = 'https://linkedin.com/'; $typeSocialProfile4 = 'linkedin'; $vcard->addSocialProfile( $socialProfile1, $typeSocialProfile1 ); $vcard->addSocialProfile( $socialProfile2, $typeSocialProfile2 ); $vcard->addSocialProfile( $socialProfile3, $typeSocialProfile3 ); $vcard->addSocialProfile( $socialProfile4, $typeSocialProfile4 ); $vcard->addCustom('X-CUSTOM(CHARSET=UTF-8,ENCODING=QUOTED-PRINTABLE,Custom1)','1'); $vcard->setSavePath(__DIR__. '/vcf/'); $vcard->save();
文档
类有良好的内联文档。
贡献
欢迎贡献,并将得到充分认可。
拉取请求
添加或更新代码
- 编码语法 - 请保持代码语法与包的其他部分一致。
- 添加单元测试! - 如果你的补丁没有测试,则不会被接受。
- 记录任何行为变化 - 确保README和任何其他相关文档都保持最新。
- 考虑我们的发布周期 - 我们尝试遵循semver。随机破坏公共API不是选项。
- 创建主题分支 - 不要要求我们从你的master分支拉取。
- 每个功能一个拉取请求 - 如果你想要做不止一件事,请发送多个拉取请求。
- 发送连贯的历史记录 - 确保你的拉取请求中的每个单独提交都有意义。如果你在开发过程中不得不进行多个中间提交,请在提交前将它们压缩。
问题
用于错误报告或代码讨论。
有关如何在help.github.com上与GitHub合作的更多信息。
致谢
许可证
此模块使用MIT许可证。简而言之,此许可证允许你做任何事,只要版权声明仍然存在。